parsers/smalltalk/extensions.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 07 Nov 2014 02:14:26 +0000
changeset 417 3c0a91182e65
parent 390 17ba167b8ee1
child 424 77c414db3cca
permissions -rw-r--r--
Smalltalk grammar updated to allow for Smalltalk/X EOL comments

"{ Package: 'stx:goodies/petitparser/parsers/smalltalk' }"!

!PPParser methodsFor:'*petitsmalltalk-operations'!

smalltalkToken
	| ws |
	ws := PPSmalltalkWhitespaceParser new.
	^ ((ws, ((PPTokenParser on: self) tokenClass: PPSmalltalkToken; yourself), ws) ==> #second)
		name: 'trimmingToken';
		yourself
! !

!RBProgramNode methodsFor:'*petitsmalltalk-accessing'!

addComments: aCollectionOfIntervals
	(aCollectionOfIntervals isNil or: [ aCollectionOfIntervals isEmpty ])
		ifFalse: [ self comments: self comments , aCollectionOfIntervals ]
! !

!RBValueToken methodsFor:'*PetitSmalltalk-Test'!

inputValue
	self flag: 'ugly hack to deal with PPToken #value deprecation '.
	^ self value
! !

!stx_goodies_petitparser_parsers_smalltalk class methodsFor:'documentation'!

extensionsVersion_HG

    ^ '$Changeset: <not expanded> $'
! !