--- a/Parser.st Mon Nov 20 14:30:08 2006 +0100
+++ b/Parser.st Mon Nov 20 22:31:47 2006 +0100
@@ -4378,6 +4378,30 @@
"Created: / 17.11.2001 / 10:23:47 / cg"
!
+emptyStatement
+ parserFlags allowEmptyStatements ifTrue:[
+ parserFlags warnAboutPossibleSTCCompilationProblems ifTrue:[
+ self
+ warning:'stc will not compile empty statements'
+ line:lineNr.
+ "/ experimental
+ Tools::CompilerWarningToDoListEntry notNil ifTrue:[
+ self todo:(((Tools::CompilerWarningToDoListEntry new
+ message:'stc will not compile empty statements')
+ className:(self classToCompileFor name)
+ selector:selector
+ checkAction:nil
+ equalityParameter:nil)
+ position:tokenPosition).
+ ].
+ ].
+ self nextToken
+ ].
+
+ "Created: / 20-11-2006 / 14:04:14 / cg"
+ "Modified: / 20-11-2006 / 15:33:11 / cg"
+!
+
parseExceptionOrContextPragma
|pragmaType|
@@ -4541,6 +4565,9 @@
"
|stats|
+ tokenType == $. ifTrue:[
+ self emptyStatement.
+ ].
stats := self parseMethodBodyOrEmpty.
(stats == #Error) ifFalse:[
self checkForEndOfInput.
@@ -4553,7 +4580,7 @@
].
^ stats
- "Modified: / 17.11.2001 / 10:31:12 / cg"
+ "Modified: / 20-11-2006 / 14:04:24 / cg"
!
parseMethodBodyOrEmpty
@@ -4570,6 +4597,9 @@
(self parseMethodBodyVarSpec == #Error) ifTrue:[^ #Error].
+ tokenType == $. ifTrue:[
+ self emptyStatement.
+ ].
(tokenType ~~ #EOF) ifTrue:[
stats := self statementList
].
@@ -4590,7 +4620,7 @@
].
^ stats
- "Modified: 27.4.1996 / 16:57:56 / cg"
+ "Modified: / 20-11-2006 / 14:04:40 / cg"
!
parseMethodBodyVarSpec
@@ -4925,6 +4955,9 @@
periodPos := tokenPosition.
self nextToken.
+ tokenType == $. ifTrue:[
+ self emptyStatement.
+ ].
(tokenType == $]) ifTrue:[
currentBlock isNil ifTrue:[
self parseError:''']'' unexpected (block nesting error)'.
@@ -4949,7 +4982,7 @@
].
^ firstStatement
- "Modified: / 05-09-2006 / 12:03:09 / cg"
+ "Modified: / 20-11-2006 / 14:05:52 / cg"
!
variableTypeDeclarationFor:aVariable
@@ -5044,7 +5077,10 @@
self markSymbolFrom:tokenPosition to:(source position1Based-1).
].
elements add:elem.
- self nextToken
+ self nextToken.
+ tokenType == $. ifTrue:[
+ self emptyStatement.
+ ].
].
arr := Array withAll:elements.
@@ -5053,7 +5089,7 @@
].
^ arr
- "Modified: / 14.4.1998 / 17:03:29 / cg"
+ "Modified: / 20-11-2006 / 14:07:39 / cg"
!
arrayConstant
@@ -8945,7 +8981,7 @@
!Parser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.529 2006-11-16 13:43:46 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.530 2006-11-20 21:31:47 cg Exp $'
! !
Parser initialize!