Keep malformed dotted candidates until their known delimiter. Dropping an * invalid file-scoped header would place its declarations in the root. The * next recorded declaration bounds this scan even when no delimiter exists. */
| 1911 | * invalid file-scoped header would place its declarations in the root. The |
| 1912 | * next recorded declaration bounds this scan even when no delimiter exists. */ |
| 1913 | static uint32_t cs_namespace_header_end(cs_scan_t *s, uint32_t a, uint32_t stop) { |
| 1914 | const char *src = s->ctx->source; |
| 1915 | uint32_t i = a; |
| 1916 | while (i < stop) { |
| 1917 | uint32_t next = cs_skip_space(src, i, stop); |
| 1918 | if (next != i) { |
| 1919 | i = next; |
| 1920 | continue; |
| 1921 | } |
| 1922 | unsigned char c = (unsigned char)src[i]; |
| 1923 | if (!cs_word_char(c) && c != '@' && c != '.') { |
| 1924 | break; |
| 1925 | } |
| 1926 | s->cost_steps++; |
| 1927 | i++; |
| 1928 | } |
| 1929 | return i; |
| 1930 | } |
| 1931 | |
| 1932 | /* End of the identifier starting at src[i] (i itself when there is none); |
| 1933 | * `dotted` accepts a qualified name. */ |
no test coverage detected