Skip to content

Commit 12e796a

Browse files
authored
Merge branch 'master' into sp/fix-legacy-dotcall-parsing
2 parents cdad824 + 783aa41 commit 12e796a

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://www.julia-vscode.org/CSTParser.jl/dev)
44
[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
5-
![](https://github.com/julia-vscode/CSTParser.jl/workflows/Run%20CI%20on%20master/badge.svg)
5+
[![Run CI on master](https://github.com/julia-vscode/CSTParser.jl/actions/workflows/jlpkgbutler-ci-master-workflow.yml/badge.svg)](https://github.com/julia-vscode/CSTParser.jl/actions/workflows/jlpkgbutler-ci-master-workflow.yml)
66
[![codecov](https://codecov.io/gh/julia-vscode/CSTParser.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/julia-vscode/CSTParser.jl)
77

88

src/components/keywords.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ function parse_local_global(ps::ParseState, islocal = true)
107107
push!(args, arg)
108108
elseif arg.head === :tuple
109109
append!(args, arg.args)
110+
append!(trivia, arg.trivia)
110111
else
111112
push!(args, arg)
112113
end

test/spec.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ function check_parents(x::EXPR)
1515
end
1616
end
1717

18+
function test_iter(ex)
19+
total = 0
20+
for x in ex
21+
@test x isa EXPR
22+
test_iter(x)
23+
total += x.fullspan
24+
end
25+
if length(ex) > 0
26+
@test total == ex.fullspan
27+
end
28+
end
1829

1930
function test_expr(s, head, n, endswithtrivia = false)
2031
x = CSTParser.parse(s)
@@ -25,6 +36,7 @@ function test_expr(s, head, n, endswithtrivia = false)
2536
@test Expr(x) == jl_parse(s)
2637
@test isempty(check_span(x))
2738
check_parents(x)
39+
test_iter(x)
2840
@test endswithtrivia ? (x.fullspan-x.span) == (last(x.trivia).fullspan - last(x.trivia).span) : (x.fullspan-x.span) == (last(x.args).fullspan - last(x.args).span)
2941
end
3042

@@ -35,7 +47,7 @@ end
3547

3648
@testset ":global" begin
3749
test_expr("global a", :global, 2)
38-
test_expr("global a, b", :global, 3)
50+
test_expr("global a, b", :global, 4)
3951
test_expr("global a, b = 2", :global, 2)
4052
test_expr("global const a = 1", :const, 3)
4153
test_expr("global const a = 1, b", :const, 3)

0 commit comments

Comments
 (0)