--- a/RegressionTests__ParserTests.st Wed May 22 21:16:57 2019 +0200
+++ b/RegressionTests__ParserTests.st Thu May 23 11:08:26 2019 +0200
@@ -123,7 +123,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -138,6 +138,7 @@
self assert:(arguments at:1) = #( 1 2 3 4 ).
"Created: / 12-01-2010 / 13:43:19 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:28:41 / Claus Gittinger"
!
testAnnotationWithByteArrayLiteral
@@ -161,7 +162,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -176,6 +177,7 @@
self assert:(arguments at:1) = #[ 64 128 192 ].
"Created: / 12-01-2010 / 13:35:36 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:28:45 / Claus Gittinger"
!
testAnnotationWithCharacterLiteral
@@ -199,7 +201,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -214,6 +216,7 @@
self assert:(arguments at:1) = $A.
"Created: / 12-01-2010 / 13:20:37 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:28:48 / Claus Gittinger"
!
testAnnotationWithFalseLiteral
@@ -237,7 +240,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -252,6 +255,7 @@
self assert:(arguments at:1) = false.
"Created: / 12-01-2010 / 13:13:26 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:28:50 / Claus Gittinger"
!
testAnnotationWithInvalidArgument
@@ -274,10 +278,11 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = true.
+ self assert:parserState hasError = true.
self assert:parseErrorOccured = true.
"Created: / 12-01-2010 / 13:48:48 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:28:53 / Claus Gittinger"
!
testAnnotationWithInvalidContentFollowed
@@ -339,7 +344,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -354,6 +359,7 @@
self assert:(arguments at:1) = #equals:.
"Created: / 12-01-2010 / 13:30:47 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:28:56 / Claus Gittinger"
!
testAnnotationWithMultiKeywordLiteral
@@ -377,7 +383,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -392,6 +398,7 @@
self assert:(arguments at:1) = #equals:from:.
"Created: / 12-01-2010 / 13:31:41 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:28:58 / Claus Gittinger"
!
testAnnotationWithNegativeNumberLiteral
@@ -415,7 +422,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -430,6 +437,7 @@
self assert:(arguments at:1) = -123.
"Created: / 12-01-2010 / 13:18:46 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:29:01 / Claus Gittinger"
!
testAnnotationWithNilLiteral
@@ -453,7 +461,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -468,6 +476,7 @@
self assert:(arguments at:1) isNil.
"Created: / 12-01-2010 / 13:13:59 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:29:04 / Claus Gittinger"
!
testAnnotationWithNumberLiteral
@@ -491,7 +500,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -506,6 +515,7 @@
self assert:(arguments at:1) = 123.
"Created: / 12-01-2010 / 13:18:15 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:29:06 / Claus Gittinger"
!
testAnnotationWithStringLiteral
@@ -529,7 +539,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -544,6 +554,7 @@
self assert:(arguments at:1) = 'Hello world!!'.
"Created: / 12-01-2010 / 13:21:43 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:29:09 / Claus Gittinger"
!
testAnnotationWithSymbolLiteral
@@ -567,7 +578,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -582,6 +593,7 @@
self assert:(arguments at:1) = #symbol.
"Created: / 12-01-2010 / 13:26:54 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:29:12 / Claus Gittinger"
!
testAnnotationWithSymbolLiteral2
@@ -605,7 +617,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -620,6 +632,7 @@
self assert:(arguments at:1) = #symbol.
"Created: / 11-07-2010 / 23:00:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 23-05-2019 / 09:29:14 / Claus Gittinger"
!
testAnnotationWithTrueLiteral
@@ -643,7 +656,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -658,6 +671,7 @@
self assert:(arguments at:1) = true.
"Created: / 12-01-2010 / 13:11:22 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:29:17 / Claus Gittinger"
!
testCompoundAnnotationLiteral
@@ -681,7 +695,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -697,6 +711,7 @@
self assert:(arguments at:2) = false.
"Created: / 12-01-2010 / 13:47:00 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:29:19 / Claus Gittinger"
!
testDislocationAfterMethodBody
@@ -720,10 +735,11 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = true.
+ self assert:parserState hasError = true.
self assert:parseErrorOccured = true.
"Created: / 12-01-2010 / 12:42:03 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:29:23 / Claus Gittinger"
!
testDislocationInMethodBody
@@ -746,10 +762,11 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = true.
+ self assert:parserState hasError = true.
self assert:parseErrorOccured = true.
"Created: / 12-01-2010 / 12:31:24 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:29:25 / Claus Gittinger"
!
testDislocationInMethodHeader
@@ -773,10 +790,11 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = true.
+ self assert:parserState hasError = true.
self assert:parseErrorOccured = true.
"Created: / 12-01-2010 / 12:29:46 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:29:28 / Claus Gittinger"
!
testEmptyAnnotation
@@ -800,7 +818,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -814,6 +832,7 @@
self assert:arguments size = 0.
"Created: / 12-01-2010 / 13:08:15 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:29:30 / Claus Gittinger"
!
testMultipleAnnotationsInMethod
@@ -836,7 +855,7 @@
" check the parser result "
self deny:parserState isNil.
self deny:parserState = #Error.
- self assert:parserState errorFlag = false.
+ self assert:parserState hasError = false.
self assert:parseErrorOccured = false.
" find the annotations record in parser state "
self deny:parserState annotations isNil.
@@ -859,6 +878,7 @@
self assert:(arguments at:1) = #argument.
"Created: / 12-01-2010 / 12:47:57 / pp <Pavel.Pospichal@gmail.com>"
+ "Modified: / 23-05-2019 / 09:29:33 / Claus Gittinger"
! !
!ParserTests methodsFor:'tests - context'!
@@ -1811,11 +1831,14 @@
with:$a)).
"/ expanded-string
- s := Scanner for:' e''one: \{ 123 } two: \{ 122+2 }\n'' '.
+ s := Scanner for:' e''one: { 123 } two: { 122+2 }\n'' '.
tok := s nextToken.
self assert:(tok == #StringFragment).
self assert:(s tokenValue = 'one: ').
+ "/ tok := s nextToken.
+ "/ self assert:(tok == ${).
+
tok := s nextToken.
self assert:(tok == #Integer).
@@ -1826,6 +1849,9 @@
self assert:(tok == #StringFragment).
self assert:(s tokenValue = ' two: ').
+ "/ tok := s nextToken.
+ "/ self assert:(tok == ${).
+
tok := s nextToken.
self assert:(tok == #Integer).
tok := s nextToken.
@@ -1842,19 +1868,25 @@
self assert:(s tokenValue = Character nl asString).
"Created: / 22-05-2019 / 20:10:24 / Claus Gittinger"
+ "Modified: / 23-05-2019 / 09:24:07 / Claus Gittinger"
!
test_121b_parse_specialStrings
|p expr|
"/ expanded-string
- p := Parser for:' e''one: \{ 123 } two: \{ 122+2 }\n'' '.
+ p := Parser for:' e''one: { 123 } two: { 122+2 }\n'' '.
p nextToken.
expr := p expression.
self assert:(expr isMessage).
self assert:(expr evaluate = c'one: 123 two: 124\n').
+ 1 to:10 do:[:i |
+ Transcript showCR: e'{i} factorial is {i factorial}'.
+ ].
+
"Created: / 22-05-2019 / 20:56:40 / Claus Gittinger"
+ "Modified: / 23-05-2019 / 09:24:57 / Claus Gittinger"
! !
!ParserTests methodsFor:'tests - sysprim'!