compiler/tests/PPCompiledSmalltalkGrammarTests.st
changeset 391 553a5456963b
child 422 116d2b2af905
equal deleted inserted replaced
390:17ba167b8ee1 391:553a5456963b
       
     1 "{ Package: 'stx:goodies/petitparser/compiler/tests' }"
       
     2 
       
     3 PPCompositeParserTest subclass:#PPCompiledSmalltalkGrammarTests
       
     4 	instanceVariableNames:''
       
     5 	classVariableNames:''
       
     6 	poolDictionaries:''
       
     7 	category:'PetitCompiler-Tests-Smalltalk'
       
     8 !
       
     9 
       
    10 !PPCompiledSmalltalkGrammarTests class methodsFor:'accessing'!
       
    11 
       
    12 packageNamesUnderTest
       
    13 	^ #('PetitSmalltalk')
       
    14 !
       
    15 
       
    16 resources
       
    17 	^ (OrderedCollection with: PPCompiledSmalltalkGrammarResource)
       
    18 		addAll: super resources;
       
    19 		yourself
       
    20 ! !
       
    21 
       
    22 !PPCompiledSmalltalkGrammarTests methodsFor:'accessing'!
       
    23 
       
    24 context
       
    25 	^ PPCContext new
       
    26 !
       
    27 
       
    28 parserClass
       
    29 	^ Smalltalk at: #PPCompiledSmalltalkGrammar
       
    30 !
       
    31 
       
    32 parserInstanceFor: aSymbol
       
    33 	^ (Smalltalk at: #PPCompiledSmalltalkGrammar) new startSymbol: aSymbol
       
    34 ! !
       
    35 
       
    36 !PPCompiledSmalltalkGrammarTests methodsFor:'testing'!
       
    37 
       
    38 testArray1
       
    39 	self 
       
    40 		parse: '{}'
       
    41 		rule: #array
       
    42 !
       
    43 
       
    44 testArray2
       
    45 	self 
       
    46 		parse: '{self foo}'
       
    47 		rule: #array
       
    48 !
       
    49 
       
    50 testArray3
       
    51 	self 
       
    52 		parse: '{self foo. self bar}'
       
    53 		rule: #array
       
    54 !
       
    55 
       
    56 testArray4
       
    57 	self 
       
    58 		parse: '{self foo. self bar.}'
       
    59 		rule: #array
       
    60 !
       
    61 
       
    62 testAssignment1
       
    63 	self 
       
    64 		parse: '1'
       
    65 		rule: #expression
       
    66 !
       
    67 
       
    68 testAssignment2
       
    69 	self 
       
    70 		parse: 'a := 1'
       
    71 		rule: #expression
       
    72 !
       
    73 
       
    74 testAssignment3
       
    75 	self 
       
    76 		parse: 'a := b := 1'
       
    77 		rule: #expression
       
    78 !
       
    79 
       
    80 testAssignment4
       
    81 	PPSmalltalkGrammar allowUnderscoreAssignment
       
    82 		ifTrue: [ self parse: 'a _ 1' rule: #expression ]
       
    83 		ifFalse: [ self fail: 'a _ 1' rule: #expression ]
       
    84 !
       
    85 
       
    86 testAssignment5
       
    87 	PPSmalltalkGrammar allowUnderscoreAssignment
       
    88 		ifTrue: [ self parse: 'a _ b _ 1' rule: #expression ]
       
    89 		ifFalse: [ self fail: 'a _ b _ 1' rule: #expression ]
       
    90 !
       
    91 
       
    92 testAssignment6
       
    93 	self 
       
    94 		parse: 'a := (b := c)'
       
    95 		rule: #expression
       
    96 !
       
    97 
       
    98 testComment1
       
    99 	self 
       
   100 		parse: '1"one"+2'
       
   101 		rule: #expression
       
   102 !
       
   103 
       
   104 testComment2
       
   105 	self 
       
   106 		parse: '1 "one" +2'
       
   107 		rule: #expression
       
   108 !
       
   109 
       
   110 testComment3
       
   111 	self 
       
   112 		parse: '1"one"+"two"2'
       
   113 		rule: #expression
       
   114 !
       
   115 
       
   116 testComment4
       
   117 	self 
       
   118 		parse: '1"one""two"+2'
       
   119 		rule: #expression
       
   120 !
       
   121 
       
   122 testComment5
       
   123 	self 
       
   124 		parse: '1"one"	"two"+2'
       
   125 		rule: #expression
       
   126 !
       
   127 
       
   128 testCompleteness
       
   129 	"This test asserts that all subclasses override all test methods."
       
   130 	
       
   131 	self class allSubclasses do: [ :subclass |
       
   132 		self class testSelectors do: [ :selector |
       
   133 			self 
       
   134 				assert: (selector = #testCompleteness or: [ subclass selectors includes: selector ])
       
   135 				description: subclass printString , ' does not test ' , selector printString ] ]
       
   136 !
       
   137 
       
   138 testMethod1
       
   139 	self 
       
   140 		parse: 'negated ^ 0 - self'
       
   141 		rule: #method
       
   142 !
       
   143 
       
   144 testMethod2
       
   145 	"Spaces at the beginning of the method."
       
   146 	self 
       
   147 		parse: '	  negated ^ 0 - self'
       
   148 		rule: #method
       
   149 !
       
   150 
       
   151 testMethod3
       
   152 	"Spaces at the end of the method."
       
   153 	self 
       
   154 		parse: '	negated ^ 0 - self  '
       
   155 		rule: #method
       
   156 !
       
   157 
       
   158 testSequence1
       
   159 	self 
       
   160 		parse: '| a | 1 . 2'
       
   161 		rule: #sequence
       
   162 !
       
   163 
       
   164 testStatements1
       
   165 	self 
       
   166 		parse: '1'
       
   167 		rule: #sequence
       
   168 !
       
   169 
       
   170 testStatements2
       
   171 	self 
       
   172 		parse: '1 . 2'
       
   173 		rule: #sequence
       
   174 !
       
   175 
       
   176 testStatements3
       
   177 	self 
       
   178 		parse: '1 . 2 . 3'
       
   179 		rule: #sequence
       
   180 !
       
   181 
       
   182 testStatements4
       
   183 	self 
       
   184 		parse: '1 . 2 . 3 .'
       
   185 		rule: #sequence
       
   186 !
       
   187 
       
   188 testStatements5
       
   189 	self 
       
   190 		parse: '1 . . 2'
       
   191 		rule: #sequence
       
   192 !
       
   193 
       
   194 testStatements6
       
   195 	self 
       
   196 		parse: '1. 2'
       
   197 		rule: #sequence
       
   198 !
       
   199 
       
   200 testStatements7
       
   201 	self 
       
   202 		parse: '. 1'
       
   203 		rule: #sequence
       
   204 !
       
   205 
       
   206 testStatements8
       
   207 	self 
       
   208 		parse: '.1'
       
   209 		rule: #sequence
       
   210 !
       
   211 
       
   212 testStatements9
       
   213 	self 
       
   214 		parse: ''
       
   215 		rule: #statements
       
   216 !
       
   217 
       
   218 testTemporaries1
       
   219 	self 
       
   220 		parse: '| a |'
       
   221 		rule: #sequence
       
   222 !
       
   223 
       
   224 testTemporaries2
       
   225 	self 
       
   226 		parse: '| a b |'
       
   227 		rule: #sequence
       
   228 !
       
   229 
       
   230 testTemporaries3
       
   231 	self 
       
   232 		parse: '| a b c |'
       
   233 		rule: #sequence
       
   234 !
       
   235 
       
   236 testVariable1
       
   237 	self 
       
   238 		parse: 'trueBinding'
       
   239 		rule: #primary
       
   240 !
       
   241 
       
   242 testVariable2
       
   243 	self 
       
   244 		parse: 'falseBinding'
       
   245 		rule: #primary
       
   246 !
       
   247 
       
   248 testVariable3
       
   249 	self 
       
   250 		parse: 'nilly'
       
   251 		rule: #primary
       
   252 !
       
   253 
       
   254 testVariable4
       
   255 	self 
       
   256 		parse: 'selfish'
       
   257 		rule: #primary
       
   258 !
       
   259 
       
   260 testVariable5
       
   261 	self 
       
   262 		parse: 'supernanny'
       
   263 		rule: #primary
       
   264 !
       
   265 
       
   266 testVariable6
       
   267 	PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [
       
   268 		self 
       
   269 			parse: 'super_nanny'
       
   270 			rule: #primary ]
       
   271 !
       
   272 
       
   273 testVariable7
       
   274 	PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [
       
   275 		self 
       
   276 			parse: '__gen_var_123__'
       
   277 			rule: #primary ]
       
   278 ! !
       
   279 
       
   280 !PPCompiledSmalltalkGrammarTests methodsFor:'testing-blocks'!
       
   281 
       
   282 testArgumentsBlock1
       
   283 	self 
       
   284 		parse: '[ :a | ]'
       
   285 		rule: #block
       
   286 !
       
   287 
       
   288 testArgumentsBlock2
       
   289 	self 
       
   290 		parse: '[ :a :b | ]'
       
   291 		rule: #block
       
   292 !
       
   293 
       
   294 testArgumentsBlock3
       
   295 	self 
       
   296 		parse: '[ :a :b :c | ]'
       
   297 		rule: #block
       
   298 !
       
   299 
       
   300 testBlock1
       
   301 	self 
       
   302 		parse: '[]'
       
   303 		rule: #block
       
   304 !
       
   305 
       
   306 testComplexBlock1
       
   307 	self 
       
   308 		parse: '[ :a | | b | c ]'
       
   309 		rule: #block
       
   310 !
       
   311 
       
   312 testComplexBlock2
       
   313 	self 
       
   314 		parse: '[:a||b|c]'
       
   315 		rule: #block
       
   316 !
       
   317 
       
   318 testSimpleBlock1
       
   319 	self 
       
   320 		parse: '[ ]'
       
   321 		rule: #block
       
   322 !
       
   323 
       
   324 testSimpleBlock2
       
   325 	self 
       
   326 		parse: '[ nil ]'
       
   327 		rule: #block
       
   328 !
       
   329 
       
   330 testSimpleBlock3
       
   331 	self 
       
   332 		parse: '[ :a ]'
       
   333 		rule: #block
       
   334 !
       
   335 
       
   336 testStatementBlock1
       
   337 	self 
       
   338 		parse: '[ nil ]'
       
   339 		rule: #block
       
   340 !
       
   341 
       
   342 testStatementBlock2
       
   343 	self 
       
   344 		parse: '[ | a | nil ]'
       
   345 		rule: #block
       
   346 !
       
   347 
       
   348 testStatementBlock3
       
   349 	self 
       
   350 		parse: '[ | a b | nil ]'
       
   351 		rule: #block
       
   352 ! !
       
   353 
       
   354 !PPCompiledSmalltalkGrammarTests methodsFor:'testing-literals'!
       
   355 
       
   356 testArrayLiteral1
       
   357 	self 
       
   358 		parse: '#()'
       
   359 		rule: #arrayLiteral
       
   360 !
       
   361 
       
   362 testArrayLiteral10
       
   363 	self 
       
   364 		parse: '#((1 2) #(1 2 3))'
       
   365 		rule: #arrayLiteral
       
   366 !
       
   367 
       
   368 testArrayLiteral11
       
   369 	self 
       
   370 		parse: '#([1 2] #[1 2 3])'
       
   371 		rule: #arrayLiteral
       
   372 !
       
   373 
       
   374 testArrayLiteral2
       
   375 	self 
       
   376 		parse: '#(1)'
       
   377 		rule: #arrayLiteral
       
   378 !
       
   379 
       
   380 testArrayLiteral3
       
   381 	self 
       
   382 		parse: '#(1 2)'
       
   383 		rule: #arrayLiteral
       
   384 !
       
   385 
       
   386 testArrayLiteral4
       
   387 	self 
       
   388 		parse: '#(true false nil)'
       
   389 		rule: #arrayLiteral
       
   390 !
       
   391 
       
   392 testArrayLiteral5
       
   393 	self 
       
   394 		parse: '#($a)'
       
   395 		rule: #arrayLiteral
       
   396 !
       
   397 
       
   398 testArrayLiteral6
       
   399 	self 
       
   400 		parse: '#(1.2)'
       
   401 		rule: #arrayLiteral
       
   402 !
       
   403 
       
   404 testArrayLiteral7
       
   405 	self 
       
   406 		parse: '#(size #at: at:put: #''=='')'
       
   407 		rule: #arrayLiteral
       
   408 !
       
   409 
       
   410 testArrayLiteral8
       
   411 	self 
       
   412 		parse: '#(''baz'')'
       
   413 		rule: #arrayLiteral
       
   414 !
       
   415 
       
   416 testArrayLiteral9
       
   417 	self 
       
   418 		parse: '#((1) 2)'
       
   419 		rule: #arrayLiteral
       
   420 !
       
   421 
       
   422 testByteLiteral1
       
   423 	self 
       
   424 		parse: '#[]'
       
   425 		rule: #byteLiteral
       
   426 !
       
   427 
       
   428 testByteLiteral2
       
   429 	self 
       
   430 		parse: '#[0]'
       
   431 		rule: #byteLiteral
       
   432 !
       
   433 
       
   434 testByteLiteral3
       
   435 	self 
       
   436 		parse: '#[255]'
       
   437 		rule: #byteLiteral
       
   438 !
       
   439 
       
   440 testByteLiteral4
       
   441 	self 
       
   442 		parse: '#[ 1 2 ]'
       
   443 		rule: #byteLiteral
       
   444 !
       
   445 
       
   446 testByteLiteral5
       
   447 	self 
       
   448 		parse: '#[ 2r1010 8r77 16rFF ]'
       
   449 		rule: #byteLiteral
       
   450 !
       
   451 
       
   452 testCharLiteral1
       
   453 	self 
       
   454 		parse: '$a'
       
   455 		rule: #charLiteral
       
   456 !
       
   457 
       
   458 testCharLiteral2
       
   459 	self 
       
   460 		parse: '$ '
       
   461 		rule: #charLiteral
       
   462 !
       
   463 
       
   464 testCharLiteral3
       
   465 	self 
       
   466 		parse: '$$'
       
   467 		rule: #charLiteral
       
   468 !
       
   469 
       
   470 testNumberLiteral1
       
   471 	self 
       
   472 		parse: '0'
       
   473 		rule: #numberLiteral
       
   474 !
       
   475 
       
   476 testNumberLiteral10
       
   477 	self 
       
   478 		parse: '10r10'
       
   479 		rule: #numberLiteral
       
   480 !
       
   481 
       
   482 testNumberLiteral11
       
   483 	self 
       
   484 		parse: '8r777'
       
   485 		rule: #numberLiteral
       
   486 !
       
   487 
       
   488 testNumberLiteral12
       
   489 	self 
       
   490 		parse: '16rAF'
       
   491 		rule: #numberLiteral
       
   492 !
       
   493 
       
   494 testNumberLiteral13
       
   495 	self 
       
   496 		parse: '16rCA.FE'
       
   497 		rule: #numberLiteral
       
   498 !
       
   499 
       
   500 testNumberLiteral14
       
   501 	self 
       
   502 		parse: '3r-22.2'
       
   503 		rule: #numberLiteral
       
   504 !
       
   505 
       
   506 testNumberLiteral15
       
   507 	self 
       
   508 		parse: '0.50s2'
       
   509 		rule: #numberLiteral
       
   510 !
       
   511 
       
   512 testNumberLiteral2
       
   513 	self 
       
   514 		parse: '0.1'
       
   515 		rule: #numberLiteral
       
   516 !
       
   517 
       
   518 testNumberLiteral3
       
   519 	self 
       
   520 		parse: '123'
       
   521 		rule: #numberLiteral
       
   522 !
       
   523 
       
   524 testNumberLiteral4
       
   525 	self 
       
   526 		parse: '123.456'
       
   527 		rule: #numberLiteral
       
   528 !
       
   529 
       
   530 testNumberLiteral5
       
   531 	self 
       
   532 		parse: '-0'
       
   533 		rule: #numberLiteral
       
   534 !
       
   535 
       
   536 testNumberLiteral6
       
   537 	self 
       
   538 		parse: '-0.1'
       
   539 		rule: #numberLiteral
       
   540 !
       
   541 
       
   542 testNumberLiteral7
       
   543 	self 
       
   544 		parse: '-123'
       
   545 		rule: #numberLiteral
       
   546 !
       
   547 
       
   548 testNumberLiteral8
       
   549 	self 
       
   550 		parse: '-125'
       
   551 		rule: #numberLiteral
       
   552 !
       
   553 
       
   554 testNumberLiteral9
       
   555 	self 
       
   556 		parse: '-123.456'
       
   557 		rule: #numberLiteral
       
   558 !
       
   559 
       
   560 testSpecialLiteral1
       
   561 	self 
       
   562 		parse: 'true'
       
   563 		rule: #trueLiteral
       
   564 !
       
   565 
       
   566 testSpecialLiteral2
       
   567 	self 
       
   568 		parse: 'false'
       
   569 		rule: #falseLiteral
       
   570 !
       
   571 
       
   572 testSpecialLiteral3
       
   573 	self 
       
   574 		parse: 'nil'
       
   575 		rule: #nilLiteral
       
   576 !
       
   577 
       
   578 testStringLiteral1
       
   579 	self 
       
   580 		parse: ''''''
       
   581 		rule: #stringLiteral
       
   582 !
       
   583 
       
   584 testStringLiteral2
       
   585 	self 
       
   586 		parse: '''ab'''
       
   587 		rule: #stringLiteral
       
   588 !
       
   589 
       
   590 testStringLiteral3
       
   591 	self 
       
   592 		parse: '''ab''''cd'''
       
   593 		rule: #stringLiteral
       
   594 !
       
   595 
       
   596 testSymbolLiteral1
       
   597 	self 
       
   598 		parse: '#foo'
       
   599 		rule: #symbolLiteral
       
   600 !
       
   601 
       
   602 testSymbolLiteral2
       
   603 	self 
       
   604 		parse: '#+'
       
   605 		rule: #symbolLiteral
       
   606 !
       
   607 
       
   608 testSymbolLiteral3
       
   609 	self 
       
   610 		parse: '#key:'
       
   611 		rule: #symbolLiteral
       
   612 !
       
   613 
       
   614 testSymbolLiteral4
       
   615 	self 
       
   616 		parse: '#key:value:'
       
   617 		rule: #symbolLiteral
       
   618 !
       
   619 
       
   620 testSymbolLiteral5
       
   621 	self 
       
   622 		parse: '#''testing-result'''
       
   623 		rule: #symbolLiteral
       
   624 !
       
   625 
       
   626 testSymbolLiteral6
       
   627 	PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [
       
   628 		self 
       
   629 			parse: '#__gen__binding'
       
   630 			rule: #symbolLiteral ]
       
   631 !
       
   632 
       
   633 testSymbolLiteral7
       
   634 	self 
       
   635 		parse: '# fucker'
       
   636 		rule: #symbolLiteral
       
   637 !
       
   638 
       
   639 testSymbolLiteral8
       
   640 	self 
       
   641 		parse: '##fucker'
       
   642 		rule: #symbolLiteral
       
   643 !
       
   644 
       
   645 testSymbolLiteral9
       
   646 	self 
       
   647 		parse: '## fucker'
       
   648 		rule: #symbolLiteral
       
   649 ! !
       
   650 
       
   651 !PPCompiledSmalltalkGrammarTests methodsFor:'testing-messages'!
       
   652 
       
   653 testBinaryExpression1
       
   654 	self 
       
   655 		parse: '1 + 2'
       
   656 		rule: #expression
       
   657 !
       
   658 
       
   659 testBinaryExpression2
       
   660 	self 
       
   661 		parse: '1 + 2 + 3'
       
   662 		rule: #expression
       
   663 !
       
   664 
       
   665 testBinaryExpression3
       
   666 	self 
       
   667 		parse: '1 // 2'
       
   668 		rule: #expression
       
   669 !
       
   670 
       
   671 testBinaryExpression4
       
   672 	self 
       
   673 		parse: '1 -- 2'
       
   674 		rule: #expression
       
   675 !
       
   676 
       
   677 testBinaryExpression5
       
   678 	self 
       
   679 		parse: '1 ==> 2'
       
   680 		rule: #expression.
       
   681 !
       
   682 
       
   683 testBinaryMethod1
       
   684 	self 
       
   685 		parse: '+ a'
       
   686 		rule: #method
       
   687 !
       
   688 
       
   689 testBinaryMethod2
       
   690 	self 
       
   691 		parse: '+ a | b |'
       
   692 		rule: #method
       
   693 !
       
   694 
       
   695 testBinaryMethod3
       
   696 	self 
       
   697 		parse: '+ a b'
       
   698 		rule: #method
       
   699 !
       
   700 
       
   701 testBinaryMethod4
       
   702 	self 
       
   703 		parse: '+ a | b | c'
       
   704 		rule: #method
       
   705 !
       
   706 
       
   707 testBinaryMethod5
       
   708 	self 
       
   709 		parse: '-- a'
       
   710 		rule: #method
       
   711 !
       
   712 
       
   713 testCascadeExpression1
       
   714 	self 
       
   715 		parse: '1 abs; negated'
       
   716 		rule: #expression
       
   717 !
       
   718 
       
   719 testCascadeExpression2
       
   720 	self 
       
   721 		parse: '1 abs negated; raisedTo: 12; negated'
       
   722 		rule: #expression
       
   723 !
       
   724 
       
   725 testCascadeExpression3
       
   726 	self 
       
   727 		parse: '1 + 2; - 3'
       
   728 		rule: #expression
       
   729 !
       
   730 
       
   731 testKeywordExpression1
       
   732 	self 
       
   733 		parse: '1 to: 2'
       
   734 		rule: #expression
       
   735 !
       
   736 
       
   737 testKeywordExpression2
       
   738 	self 
       
   739 		parse: '1 to: 2 by: 3'
       
   740 		rule: #expression
       
   741 !
       
   742 
       
   743 testKeywordExpression3
       
   744 	self 
       
   745 		parse: '1 to: 2 by: 3 do: 4'
       
   746 		rule: #expression
       
   747 !
       
   748 
       
   749 testKeywordMethod1
       
   750 	self 
       
   751 		parse: 'to: a'
       
   752 		rule: #method
       
   753 !
       
   754 
       
   755 testKeywordMethod2
       
   756 	self 
       
   757 		parse: 'to: a do: b | c |'
       
   758 		rule: #method
       
   759 !
       
   760 
       
   761 testKeywordMethod3
       
   762 	self 
       
   763 		parse: 'to: a do: b by: c d'
       
   764 		rule: #method
       
   765 !
       
   766 
       
   767 testKeywordMethod4
       
   768 	self 
       
   769 		parse: 'to: a do: b by: c | d | e'
       
   770 		rule: #method
       
   771 !
       
   772 
       
   773 testUnaryExpression1
       
   774 	self 
       
   775 		parse: '1 abs'
       
   776 		rule: #expression
       
   777 !
       
   778 
       
   779 testUnaryExpression2
       
   780 	self 
       
   781 		parse: '1 abs negated'
       
   782 		rule: #expression
       
   783 !
       
   784 
       
   785 testUnaryMethod1
       
   786 	self 
       
   787 		parse: 'abs'
       
   788 		rule: #method
       
   789 !
       
   790 
       
   791 testUnaryMethod2
       
   792 	self 
       
   793 		parse: 'abs | a |'
       
   794 		rule: #method
       
   795 !
       
   796 
       
   797 testUnaryMethod3
       
   798 	self 
       
   799 		parse: 'abs a'
       
   800 		rule: #method
       
   801 !
       
   802 
       
   803 testUnaryMethod4
       
   804 	self 
       
   805 		parse: 'abs | a | b'
       
   806 		rule: #method
       
   807 !
       
   808 
       
   809 testUnaryMethod5
       
   810 	self 
       
   811 		parse: 'abs | a |'
       
   812 		rule: #method
       
   813 ! !
       
   814 
       
   815 !PPCompiledSmalltalkGrammarTests methodsFor:'testing-pragmas'!
       
   816 
       
   817 testPragma1
       
   818 	self 
       
   819 		parse: 'method <foo>'
       
   820 		rule: #method
       
   821 !
       
   822 
       
   823 testPragma10
       
   824 	self 
       
   825 		parse: 'method <foo: bar>'
       
   826 		rule: #method
       
   827 !
       
   828 
       
   829 testPragma11
       
   830 	self 
       
   831 		parse: 'method <foo: true>'
       
   832 		rule: #method
       
   833 !
       
   834 
       
   835 testPragma12
       
   836 	self 
       
   837 		parse: 'method <foo: false>'
       
   838 		rule: #method
       
   839 !
       
   840 
       
   841 testPragma13
       
   842 	self 
       
   843 		parse: 'method <foo: nil>'
       
   844 		rule: #method
       
   845 !
       
   846 
       
   847 testPragma14
       
   848 	self 
       
   849 		parse: 'method <foo: ()>'
       
   850 		rule: #method
       
   851 !
       
   852 
       
   853 testPragma15
       
   854 	self 
       
   855 		parse: 'method <foo: #()>'
       
   856 		rule: #method
       
   857 !
       
   858 
       
   859 testPragma16
       
   860 	self 
       
   861 		parse: 'method < + 1 >'
       
   862 		rule: #method
       
   863 !
       
   864 
       
   865 testPragma2
       
   866 	self 
       
   867 		parse: 'method <foo> <bar>'
       
   868 		rule: #method
       
   869 !
       
   870 
       
   871 testPragma3
       
   872 	self 
       
   873 		parse: 'method | a | <foo>'
       
   874 		rule: #method
       
   875 !
       
   876 
       
   877 testPragma4
       
   878 	self 
       
   879 		parse: 'method <foo> | a |'
       
   880 		rule: #method
       
   881 !
       
   882 
       
   883 testPragma5
       
   884 	self 
       
   885 		parse: 'method <foo> | a | <bar>'
       
   886 		rule: #method
       
   887 !
       
   888 
       
   889 testPragma6
       
   890 	self 
       
   891 		parse: 'method <foo: 1>'
       
   892 		rule: #method
       
   893 !
       
   894 
       
   895 testPragma7
       
   896 	self 
       
   897 		parse: 'method <foo: 1.2>'
       
   898 		rule: #method
       
   899 !
       
   900 
       
   901 testPragma8
       
   902 	self 
       
   903 		parse: 'method <foo: ''bar''>'
       
   904 		rule: #method
       
   905 !
       
   906 
       
   907 testPragma9
       
   908 	self 
       
   909 		parse: 'method <foo: #''bar''>'
       
   910 		rule: #method
       
   911 ! !
       
   912