Skip to content

Commit

Permalink
Replace use of scanner.peek with scanner.check to fix rbx parse bug
Browse files Browse the repository at this point in the history
StringScanner.peek() doesnt seem to work quite the same as other
implementations when scanning over utf8 characters in strings. For each
character, the index seems to skip 1 position. #check and #scan still
work, but #peek uses a different implementation which seems to be the
problem.
  • Loading branch information
adambeynon committed Dec 13, 2013
1 parent b0573f9 commit 5f7ec71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/opal/parser/lexer.rb
Expand Up @@ -490,7 +490,7 @@ def heredoc_identifier
def process_identifier(matched, cmd_start)
last_state = @lex_state

if scanner.peek(2) != '::' && scan(/:/)
if !check(/::/) and scan(/:/)
@lex_state = :expr_beg
self.yylval = matched
return :tLABEL
Expand Down

0 comments on commit 5f7ec71

Please sign in to comment.