--- a/compiler/PPTokenizingCompiledParser.st Sun May 10 06:28:36 2015 +0100
+++ b/compiler/PPTokenizingCompiledParser.st Tue May 12 01:24:03 2015 +0100
@@ -23,6 +23,10 @@
]
!
+consumeWhitespace
+ self shouldBeImplemented
+!
+
currentTokenType
currentTokenType isNil ifTrue: [ self nextToken ].
^ currentTokenType
@@ -49,8 +53,24 @@
self shouldBeImplemented
!
-parseOn: input
+parseOn: aPPContext
+ | retval |
+
+ context := aPPContext.
+ context compiledParser: self.
+ failure := PPFailure new message: nil; context: context; position: -1.
+ context noteFailure: failure.
+ error := false.
currentTokenType := nil.
- ^ super parseOn: input.
+
+ self consumeWhitespace.
+ retval := self perform: startSymbol.
+ self consumeWhitespace.
+
+ (retval isPetitFailure) ifTrue: [ aPPContext noteFailure: failure ].
+ error ifTrue: [ aPPContext noteFailure: failure. retval := failure ].
+
+" aPPContext position: context position."
+ ^ retval
! !