Skip to content

Commit 83f9aec

Browse files
author
Ary Borenszweig
committedMar 23, 2017
Fixed #4155: parser bug with / after call with parentheses
1 parent 874eb8b commit 83f9aec

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
 

‎spec/compiler/parser/parser_spec.cr

+3
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,9 @@ describe "Parser" do
836836
it_parses "begin\n/ /\nend", Expressions.new([regex(" ")] of ASTNode)
837837
it_parses "/\\//", regex("/")
838838
it_parses "%r(/)", regex("/")
839+
it_parses "a()/3", Call.new("a".call, "/", 3.int32)
840+
it_parses "a() /3", Call.new("a".call, "/", 3.int32)
841+
it_parses "a.b() /3", Call.new(Call.new("a".call, "b"), "/", 3.int32)
839842

840843
it_parses "1 =~ 2", Call.new(1.int32, "=~", 2.int32)
841844
it_parses "1.=~(2)", Call.new(1.int32, "=~", 2.int32)

‎src/compiler/crystal/syntax/parser.cr

+1
Original file line numberDiff line numberDiff line change
@@ -3892,6 +3892,7 @@ module Crystal
38923892
end
38933893
end
38943894
end_location = token_end_location
3895+
@wants_regex = false
38953896
next_token_skip_space
38963897
end
38973898

0 commit comments

Comments
 (0)
Please sign in to comment.