author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 24 Jul 2019 21:13:30 +0000 | |
changeset 643 | 65da3a4195b6 |
parent 642 | 77d5fddb6462 |
permissions | -rw-r--r-- |
642
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
377
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
377
diff
changeset
|
2 |
|
4 | 3 |
"{ Package: 'stx:goodies/petitparser' }" |
0 | 4 |
|
5 |
PPListParser subclass:#PPChoiceParser |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'PetitParser-Parsers' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!PPChoiceParser methodsFor:'operations'! |
|
14 |
||
36 | 15 |
/ aRule |
0 | 16 |
^ self copyWith: aRule |
17 |
! ! |
|
18 |
||
19 |
!PPChoiceParser methodsFor:'parsing'! |
|
20 |
||
377
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
21 |
parseOn: aPPContext |
0 | 22 |
"This is optimized code that avoids unnecessary block activations, do not change. When all choices fail, the last failure is answered." |
23 |
||
24 |
| element | |
|
25 |
1 to: parsers size do: [ :index | |
|
26 |
element := (parsers at: index) |
|
377
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
27 |
parseOn: aPPContext. |
0 | 28 |
element isPetitFailure |
29 |
ifFalse: [ ^ element ] ]. |
|
30 |
^ element |
|
31 |
! ! |
|
32 |
||
33 |
!PPChoiceParser class methodsFor:'documentation'! |
|
34 |
||
36 | 35 |
version |
36 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPChoiceParser.st,v 1.3 2012-05-04 22:05:05 vrany Exp $' |
|
37 |
! |
|
38 |
||
39 |
version_CVS |
|
40 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPChoiceParser.st,v 1.3 2012-05-04 22:05:05 vrany Exp $' |
|
41 |
! |
|
42 |
||
0 | 43 |
version_SVN |
642
77d5fddb6462
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
377
diff
changeset
|
44 |
^ '§Id: PPChoiceParser.st 2 2010-12-17 18:44:23Z vranyj1 §' |
0 | 45 |
! ! |
377
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
36
diff
changeset
|
46 |