friendlyparser: go back upto 2 words looking for match
authorKshitij Bansal <kshitij@cs.nyu.edu>
Thu, 10 Jul 2014 17:06:30 +0000 (13:06 -0400)
committerKshitij Bansal <kshitij@cs.nyu.edu>
Thu, 10 Jul 2014 17:06:30 +0000 (13:06 -0400)
src/parser/antlr_input.cpp

index d72b311cb8266123630f09f5fbe2a140f4357f6f..aa431ef428f5e88d60074aabb3ccf8ab5f972173 100644 (file)
@@ -402,7 +402,7 @@ std::string parseErrorHelper(const char* lineStart, int charPositionInLine, cons
     } else {
       bool foundCaretPos = false;
 
-      for(int tries = 0; tries < 1 && caretPos > 0 && !foundCaretPos; ++tries) {
+      for(int tries = 0; tries < 2 && caretPos > 0 && !foundCaretPos; ++tries) {
         // go to nearest alphanumeric string (before current position),
         // see if that word can be found in original message. If so,
         // point to that, else keep pointer where it was.