author | Jan Vrany <jan.vrany@labware.com> |
Wed, 10 Jun 2020 21:33:27 +0100 | |
changeset 650 | 4c6ed0a28d18 |
parent 502 | 1e45d3c96ec5 |
permissions | -rw-r--r-- |
4 | 1 |
"{ Package: 'stx:goodies/petitparser' }" |
0 | 2 |
|
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
3 |
"{ NameSpace: Smalltalk }" |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
4 |
|
0 | 5 |
PPDelegateParser subclass:#PPFlattenParser |
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'PetitParser-Parsers' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!PPFlattenParser methodsFor:'hooks'! |
|
14 |
||
15 |
create: aCollection start: aStartInteger stop: aStopInteger |
|
16 |
^ aCollection copyFrom: aStartInteger to: aStopInteger |
|
17 |
! ! |
|
18 |
||
19 |
!PPFlattenParser methodsFor:'parsing'! |
|
20 |
||
377
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
21 |
parseOn: aPPContext |
165 | 22 |
| start element | |
377
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
23 |
start := aPPContext position. |
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
24 |
element := parser parseOn: aPPContext. |
165 | 25 |
element isPetitFailure ifTrue: [ ^ element ]. |
377
6112a403a52d
Updated to latest version from Moose repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
26 |
^ self on: aPPContext stream collection start: start + 1 stop: aPPContext position value: element |
165 | 27 |
! ! |
28 |
||
29 |
!PPFlattenParser methodsFor:'private'! |
|
30 |
||
31 |
on: aCollection start: aStartInteger stop: aStopInteger value: anObject |
|
32 |
^ aCollection copyFrom: aStartInteger to: aStopInteger |
|
0 | 33 |
! ! |
34 |
||
35 |
!PPFlattenParser class methodsFor:'documentation'! |
|
36 |
||
15 | 37 |
version |
165 | 38 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPFlattenParser.st,v 1.4 2014-03-04 14:32:30 cg Exp $' |
15 | 39 |
! |
40 |
||
41 |
version_CVS |
|
165 | 42 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPFlattenParser.st,v 1.4 2014-03-04 14:32:30 cg Exp $' |
15 | 43 |
! |
44 |
||
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
45 |
version_HG |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
46 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
47 |
^ '$Changeset: <not expanded> $' |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
48 |
! |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
377
diff
changeset
|
49 |
|
0 | 50 |
version_SVN |
165 | 51 |
^ '$Id: PPFlattenParser.st,v 1.4 2014-03-04 14:32:30 cg Exp $' |
0 | 52 |
! ! |
165 | 53 |