PPStartOfLine.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 02 Jun 2015 00:16:55 +0100
changeset 479 6316a98b7150
parent 377 6112a403a52d
permissions -rw-r--r--
Action inlining [1/x]: Initial support for inlining actions parsers (i.e., ==>) The code of the action is now inlined into parsing method rather then delegated to stored block. Mapping parser (i.e., map:[...]) are not supported and not detected, so using them cause crash. This will be fixed later.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
377
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/petitparser' }"
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
PPParser subclass:#PPStartOfLine
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
	instanceVariableNames:''
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
	classVariableNames:''
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	poolDictionaries:''
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	category:'PetitParser-Parsers'
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
!
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
!PPStartOfLine methodsFor:'parsing'!
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
parseOn: aPPContext
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
	(aPPContext isStartOfLine) ifTrue: [ 
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
		^ #startOfLine
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
	].
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
	^ PPFailure message: 'Start of line expected' context: aPPContext at: aPPContext position
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
! !
6112a403a52d Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18