Skip to content

Commit

Permalink
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/compiler/parser/parser_spec.cr
Original file line number Diff line number Diff line change
@@ -857,6 +857,7 @@ describe "Parser" do
it_parses "/ /; / /", [regex(" "), regex(" ")] of ASTNode
it_parses "/ /\n/ /", [regex(" "), regex(" ")] of ASTNode
it_parses "a = / /", Assign.new("a".var, regex(" "))
it_parses "(/ /)", Expressions.new([regex(" ")] of ASTNode)
it_parses "a = /=/", Assign.new("a".var, regex("="))
it_parses "a; if / /; / /; elsif / /; / /; end", ["a".call, If.new(regex(" "), regex(" "), If.new(regex(" "), regex(" ")))]
it_parses "a; if / /\n/ /\nelsif / /\n/ /\nend", ["a".call, If.new(regex(" "), regex(" "), If.new(regex(" "), regex(" ")))]
1 change: 1 addition & 0 deletions src/compiler/crystal/syntax/parser.cr
Original file line number Diff line number Diff line change
@@ -1597,6 +1597,7 @@ module Crystal

def parse_parenthesized_expression
location = @token.location
slash_is_regex!
next_token_skip_space_or_newline

if @token.type == :")"

0 comments on commit 27697cf

Please sign in to comment.