Fix in SmallSenseParser>>primary - make it more tolerant to syntax error.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 19 Aug 2013 14:10:06 +0100
changeset 62 27fcd7049364
parent 61 14e6a63a43a5
child 63 fe86b749d233
Fix in SmallSenseParser>>primary - make it more tolerant to syntax error. In case of syntax error, try return error-node instead and try to recover and continue. Improves code completion.
SmallSenseParser.st
smallsense.rc
--- a/SmallSenseParser.st	Mon Aug 19 10:17:30 2013 +0100
+++ b/SmallSenseParser.st	Mon Aug 19 14:10:06 2013 +0100
@@ -117,6 +117,19 @@
 
 !SmallSenseParser methodsFor:'parsing-expressions'!
 
+primary
+    | nodeOrError |
+
+    nodeOrError := super primary.
+    ^ (nodeOrError == #Error and:[error notNil]) ifTrue:[
+        error
+    ] ifFalse:[
+        nodeOrError 
+    ]
+
+    "Created: / 19-08-2013 / 14:07:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 primary_expression
     "parse a parentized expression primary; return a node-tree, or raise an Error."
 
--- a/smallsense.rc	Mon Aug 19 10:17:30 2013 +0100
+++ b/smallsense.rc	Mon Aug 19 14:10:06 2013 +0100
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Thu, 15 Aug 2013 14:25:44 GMT\0"
+      VALUE "ProductDate", "Mon, 19 Aug 2013 09:13:41 GMT\0"
     END
 
   END