PPLiteralObjectParser.st
changeset 17 8d881a6c0ea3
parent 4 90de244a7fa2
child 170 38bf7423a5d4
equal deleted inserted replaced
16:3b8de4bf5696 17:8d881a6c0ea3
     5 	classVariableNames:''
     5 	classVariableNames:''
     6 	poolDictionaries:''
     6 	poolDictionaries:''
     7 	category:'PetitParser-Parsers'
     7 	category:'PetitParser-Parsers'
     8 !
     8 !
     9 
     9 
    10 PPLiteralObjectParser comment:'A parser that accepts a single literal object, such as a character. This is the same as the predicate parser ''PPPredicateParser expect: literal'' but slightly more efficient.'
       
    11 !
       
    12 
       
    13 
    10 
    14 !PPLiteralObjectParser methodsFor:'operators'!
    11 !PPLiteralObjectParser methodsFor:'operators'!
    15 
    12 
    16 caseInsensitive
    13 caseInsensitive
    17 	"Answer a parser that can parse the receiver case-insensitive."
    14 	"Answer a parser that can parse the receiver case-insensitive."
    18 
    15 	
    19 	literal asUppercase = literal asLowercase ifTrue: [ ^ self ].
    16 	literal asUppercase = literal asLowercase ifTrue: [ ^ self ].
    20 	^ PPPredicateObjectParser on: [ :value | literal sameAs: value ] message: message
    17 	^ PPPredicateObjectParser on: [ :value | literal sameAs: value ] message: message
    21 ! !
    18 ! !
    22 
    19 
    23 !PPLiteralObjectParser methodsFor:'parsing'!
    20 !PPLiteralObjectParser methodsFor:'parsing'!
    28 		ifTrue: [ aStream next ]
    25 		ifTrue: [ aStream next ]
    29 ! !
    26 ! !
    30 
    27 
    31 !PPLiteralObjectParser class methodsFor:'documentation'!
    28 !PPLiteralObjectParser class methodsFor:'documentation'!
    32 
    29 
       
    30 version
       
    31     ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPLiteralObjectParser.st,v 1.3 2012-05-04 22:00:17 vrany Exp $'
       
    32 !
       
    33 
       
    34 version_CVS
       
    35     ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPLiteralObjectParser.st,v 1.3 2012-05-04 22:00:17 vrany Exp $'
       
    36 !
       
    37 
    33 version_SVN
    38 version_SVN
    34     ^ '$Id: PPLiteralObjectParser.st,v 1.2 2012-01-13 11:22:50 cg Exp $'
    39     ^ '§Id: PPLiteralObjectParser.st 2 2010-12-17 18:44:23Z vranyj1 §'
    35 ! !
    40 ! !