From 8b863c976466c5c6373e921fe152a575ce3f0416 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 29 Mar 2015 22:53:38 -0400 Subject: [PATCH] Lexer: Fixed /pattern/ detection at EOS --- src/Lexer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Lexer.cpp b/src/Lexer.cpp index 5e1f7ea36..4f893df19 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -869,7 +869,8 @@ bool Lexer::isPattern (std::string& token, Lexer::Type& type) std::string extractedToken; Lexer::Type extractedType; if (isString (extractedToken, extractedType, '/') && - isWhitespace (_text[_cursor])) + (_text[_cursor] == '\0' || + isWhitespace (_text[_cursor]))) { token = _text.substr (marker, _cursor - marker); type = Lexer::Type::pattern;