author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 12 May 2015 01:24:03 +0100 | |
changeset 459 | 4751c407bb40 |
parent 377 | 6112a403a52d |
permissions | -rw-r--r-- |
4 | 1 |
"{ Package: 'stx:goodies/petitparser' }" |
0 | 2 |
|
459
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
3 |
"{ NameSpace: Smalltalk }" |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
4 |
|
0 | 5 |
PPLiteralParser subclass:#PPLiteralObjectParser |
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'PetitParser-Parsers' |
|
10 |
! |
|
11 |
||
12 |
||
459
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
13 |
|
0 | 14 |
!PPLiteralObjectParser methodsFor:'operators'! |
15 |
||
16 |
caseInsensitive |
|
17 |
"Answer a parser that can parse the receiver case-insensitive." |
|
17 | 18 |
|
0 | 19 |
literal asUppercase = literal asLowercase ifTrue: [ ^ self ]. |
20 |
^ PPPredicateObjectParser on: [ :value | literal sameAs: value ] message: message |
|
170 | 21 |
! |
22 |
||
23 |
negate |
|
24 |
^ (PPPredicateObjectParser expect: literal message: message) negate |
|
0 | 25 |
! ! |
26 |
||
27 |
!PPLiteralObjectParser methodsFor:'parsing'! |
|
28 |
||
377
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
29 |
parseOn: aPPContext |
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
30 |
^ (aPPContext stream atEnd not and: [ literal = aPPContext stream uncheckedPeek ]) |
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
31 |
ifFalse: [ PPFailure message: message context: aPPContext ] |
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
170
diff
changeset
|
32 |
ifTrue: [ aPPContext stream next ] |
0 | 33 |
! ! |
34 |
||
35 |
!PPLiteralObjectParser class methodsFor:'documentation'! |
|
36 |
||
17 | 37 |
version |
170 | 38 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPLiteralObjectParser.st,v 1.4 2014-03-04 14:33:00 cg Exp $' |
17 | 39 |
! |
40 |
||
41 |
version_CVS |
|
170 | 42 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPLiteralObjectParser.st,v 1.4 2014-03-04 14:33:00 cg Exp $' |
17 | 43 |
! |
44 |
||
459
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
45 |
version_HG |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
46 |
|
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
47 |
^ '$Changeset: <not expanded> $' |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
48 |
! |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
49 |
|
0 | 50 |
version_SVN |
170 | 51 |
^ '$Id: PPLiteralObjectParser.st,v 1.4 2014-03-04 14:33:00 cg Exp $' |
0 | 52 |
! ! |
170 | 53 |