Parser.st
changeset 1182 34aac67e6e72
parent 1180 6c9e56ce34dc
child 1186 014c3db76517
--- a/Parser.st	Fri Sep 07 17:09:25 2001 +0200
+++ b/Parser.st	Tue Sep 11 12:21:32 2001 +0200
@@ -3236,29 +3236,29 @@
             (tokenType == $) ) ifTrue:[
                 eMsg := 'missing '']'' or bad '')'' in block'
             ] ifFalse:[
-                eMsg := 'missing ''.'' between statements (i.e. ' , tokenType printString , ' token unexpected)'
+                eMsg := 'missing ''.'' between statements (i.e. ''' , tokenType printString , '''-token unexpected)'
             ].
             self syntaxError:eMsg position:tokenPosition to:tokenPosition.
             ^ #Error
-        ] ifTrue:[
-            prevStatement := thisStatement.
-            self nextToken.
-            tokenType == $] ifTrue:[
-"
-                *** I had a warning here (since it was not defined
-                *** in the blue-book; but PD-code contains a lot of
-                *** code with periods at the end so that the warnings
-                *** became annoying
-
-                self warning:'period after last statement in block'.
-"
-                self markBracketAt:tokenPosition.
-                ^ firstStatement
-            ].
-            thisStatement := self statement.
-            (thisStatement == #Error) ifTrue:[^ #Error].
-            prevStatement nextStatement:thisStatement
-        ]
+        ].
+        prevStatement := thisStatement.
+        self nextToken.
+
+        tokenType == $] ifTrue:[
+            "
+            *** I had a warning here (since it was not defined
+            *** in the blue-book; but PD-code contains a lot of
+            *** code with periods at the end so that the warnings
+            *** became annoying
+
+            self warning:'period after last statement in block'.
+            "
+            self markBracketAt:tokenPosition.
+            ^ firstStatement
+        ].
+        thisStatement := self statement.
+        (thisStatement == #Error) ifTrue:[^ #Error].
+        prevStatement nextStatement:thisStatement
     ].
     self markBracketAt:tokenPosition.
     ^ firstStatement
@@ -3290,6 +3290,9 @@
     ].
     tree := self expression.
     (self errorFlag or:[tree == #Error]) ifTrue:[^ #Error].
+"/    tokenType ~~ #EOF ifTrue:[
+"/        self parseError:'nothing more expected' position:tokenPosition
+"/    ].
     ^ tree
 
     "Created: / 14.12.1999 / 15:11:37 / cg"
@@ -3363,8 +3366,8 @@
      empty (or comment only) input is accepted and returns nil.
 
      methodBodyOrNil ::= '<' st80Primitive '>'
-			 | '<' st80Primitive '>' methodBodyVarSpec statementList
-			 | <empty>
+                         | '<' st80Primitive '>' methodBodyVarSpec statementList
+                         | <empty>
     "
 
     |stats|
@@ -3372,7 +3375,11 @@
     (self parseMethodBodyVarSpec == #Error) ifTrue:[^ #Error].
 
     (tokenType ~~ #EOF) ifTrue:[
-	stats := self statementList
+        stats := self statementList
+    ].
+    (tokenType ~~ #EOF) ifTrue:[
+        self parseError:'nothing more expected here' position:tokenPosition to:tokenPosition.
+        ^ #Error
     ].
     ^ stats
 
@@ -5918,6 +5925,6 @@
 !Parser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.295 2001-09-05 15:40:57 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.296 2001-09-11 10:21:32 cg Exp $'
 ! !
 Parser initialize!