Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e8aca9663595
Choose a base ref
...
head repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6aa40d014fe5
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Oct 29, 2017

  1. Copy the full SHA
    0c22505 View commit details

Commits on Oct 30, 2017

  1. Merge pull request #5208 from MakeNowJust/fix/crystal/parse-regex-sta…

    …rting-semicolon-after-call
    
    Fix to parse regex starting with ';' after call
    asterite authored Oct 30, 2017
    Copy the full SHA
    6aa40d0 View commit details
Showing with 2 additions and 1 deletion.
  1. +1 −0 spec/compiler/parser/parser_spec.cr
  2. +1 −1 src/compiler/crystal/syntax/lexer.cr
1 change: 1 addition & 0 deletions spec/compiler/parser/parser_spec.cr
Original file line number Diff line number Diff line change
@@ -882,6 +882,7 @@ describe "Parser" do
it_parses "foo(/ /)", Call.new(nil, "foo", regex(" "))
it_parses "foo(/ /, / /)", Call.new(nil, "foo", [regex(" "), regex(" ")] of ASTNode)
it_parses "foo a, / /", Call.new(nil, "foo", ["a".call, regex(" ")] of ASTNode)
it_parses "foo /;/", Call.new(nil, "foo", regex(";"))

it_parses "$?", Global.new("$?")
it_parses "$?.foo", Call.new(Global.new("$?"), "foo")
2 changes: 1 addition & 1 deletion src/compiler/crystal/syntax/lexer.cr
Original file line number Diff line number Diff line change
@@ -277,7 +277,7 @@ module Crystal
@token.type = :DELIMITER_START
@token.delimiter_state = Token::DelimiterState.new(:regex, '/', '/')
@token.raw = "/"
elsif char.ascii_whitespace? || char == '\0' || char == ';'
elsif char.ascii_whitespace? || char == '\0'
@token.type = :"/"
elsif @wants_regex
@token.type = :DELIMITER_START