author | Jan Vrany <jan.vrany@labware.com> |
Wed, 10 Jun 2020 21:33:27 +0100 | |
changeset 650 | 4c6ed0a28d18 |
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 |
PPDelegateParser subclass:#PPEndOfInputParser |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'PetitParser-Parsers' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!PPEndOfInputParser methodsFor:'operations'! |
|
14 |
||
15 |
end |
|
16 |
^ self |
|
17 |
! ! |
|
18 |
||
19 |
!PPEndOfInputParser methodsFor:'parsing'! |
|
20 |
||
377
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
26
diff
changeset
|
21 |
parseOn: aPPContext |
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
26
diff
changeset
|
22 |
| memento result | |
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
26
diff
changeset
|
23 |
memento := aPPContext remember. |
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
26
diff
changeset
|
24 |
result := parser parseOn: aPPContext. |
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
26
diff
changeset
|
25 |
(result isPetitFailure or: [ aPPContext stream atEnd ]) |
0 | 26 |
ifTrue: [ ^ result ]. |
27 |
result := PPFailure |
|
28 |
message: 'end of input expected' |
|
377
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
26
diff
changeset
|
29 |
context: aPPContext. |
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
26
diff
changeset
|
30 |
aPPContext restore: memento. |
0 | 31 |
^ result |
32 |
! ! |
|
33 |
||
34 |
!PPEndOfInputParser class methodsFor:'documentation'! |
|
35 |
||
26 | 36 |
version |
37 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPEndOfInputParser.st,v 1.3 2012-05-04 22:02:18 vrany Exp $' |
|
38 |
! |
|
39 |
||
40 |
version_CVS |
|
41 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPEndOfInputParser.st,v 1.3 2012-05-04 22:02:18 vrany Exp $' |
|
42 |
! |
|
43 |
||
0 | 44 |
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
|
45 |
^ '§Id: PPEndOfInputParser.st 2 2010-12-17 18:44:23Z vranyj1 §' |
0 | 46 |
! ! |
377
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
26
diff
changeset
|
47 |