fix exor parsing
Showing 2 of 3 files from the diff.
src/utils.jl
changed.
src/components/keywords.jl
changed.
Other files ignored by Codecov
test/parser.jl
has changed.
@@ -488,14 +488,16 @@
Loading
488 | 488 | ||
489 | 489 | # though we now check whether there is a sequence at the end of x0.args and |
|
490 | 490 | # x1.args that match |
|
491 | + | offset = sizeof(s1) |
|
491 | 492 | for i = 0:min(last(r1), length(x0.args), length(x1.args)) - 1 |
|
492 | 493 | # if x0.args[end - i].fullspan !== x1.args[end - i].fullspan || |
|
493 | 494 | # headof(x0.args[end-i]) == :errortoken ? a : !comp(x0.args[end - i].head, x1.args[end - i].head) |
|
494 | - | if !comp(x0.args[end - i], x1.args[ end - i]) |
|
495 | + | if !comp(x0.args[end - i], x1.args[ end - i]) || offset <= i1 |
|
495 | 496 | r2 = first(r2):length(x1.args) - i |
|
496 | 497 | r3 = length(x0.args) .+ ((-i + 1):0) |
|
497 | 498 | break |
|
498 | 499 | end |
|
500 | + | offset -= x1.args[end - i].fullspan |
|
499 | 501 | end |
|
500 | 502 | inds && return r1, r2, r3 |
|
501 | 503 | x2 = CSTParser.EXPR(x0.head, CSTParser.EXPR[ |
@@ -5,6 +5,9 @@
Loading
5 | 5 | """ |
|
6 | 6 | function parse_kw(ps::ParseState) |
|
7 | 7 | k = kindof(ps.t) |
|
8 | + | if ps.closer.precedence == 20 && ps.lt.kind === Tokens.EX_OR && k !== Tokens.END |
|
9 | + | return EXPR(:IDENTIFIER, ps) |
|
10 | + | end |
|
8 | 11 | if k === Tokens.IF |
|
9 | 12 | return @default ps @closer ps :block parse_if(ps) |
|
10 | 13 | elseif k === Tokens.LET |
Files | Coverage |
---|---|
src | 86.75% |
Project Totals (15 files) | 86.75% |
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.