Skip to content

Commit

Permalink
Detect unterminated regex when EOF reached
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-rushakoff committed Jul 12, 2016
1 parent d048501 commit cd05b81
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tick/ast/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ func lexRegex(l *lexer) stateFn {
case r == '/':
l.emit(TokenRegex)
return lexToken
case r == eof:
return l.errorf("unterminated regex")
default:
//absorb
}
Expand Down

0 comments on commit cd05b81

Please sign in to comment.