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:
127
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:
127
diff
changeset
|
2 |
|
75 | 3 |
"{ Package: 'stx:goodies/petitparser/devtools' }" |
4 |
||
5 |
Object subclass:#PPDebugger |
|
6 |
instanceVariableNames:'indent' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'PetitParser-Debugging' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!PPDebugger class methodsFor:'instance creation'! |
|
14 |
||
15 |
new |
|
16 |
"return an initialized instance" |
|
17 |
||
18 |
^ self basicNew initialize. |
|
19 |
! ! |
|
20 |
||
21 |
!PPDebugger methodsFor:'events'! |
|
22 |
||
23 |
enterParser: aPPParser stream: aStream |
|
24 |
||
25 |
indent timesRepeat:[Transcript nextPutAll:' ']. |
|
26 |
Transcript nextPutAll:'{ '. |
|
27 |
Transcript nextPutAll: aPPParser name ? aPPParser printString. |
|
127 | 28 |
[ |
29 |
Transcript nextPutAll: ' pos = '; nextPutAll: aStream position printString. |
|
30 |
] on: Error do:[:ex| |
|
31 |
Debugger enter. |
|
32 |
]. |
|
75 | 33 |
Transcript cr. |
34 |
indent := indent + 1. |
|
35 |
||
36 |
"Created: / 12-03-2012 / 16:41:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
127 | 37 |
"Modified: / 11-01-2013 / 15:16:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
75 | 38 |
! |
39 |
||
40 |
leaveParser: aPPParser stream: aStream result: result |
|
41 |
||
42 |
indent := indent - 1. |
|
43 |
indent timesRepeat:[Transcript nextPutAll:' ']. |
|
44 |
Transcript nextPutAll:'} '. |
|
45 |
Transcript nextPutAll: aPPParser name ? aPPParser printString. |
|
127 | 46 |
Transcript nextPutAll: ' pos = '; nextPutAll: aStream position printString. |
75 | 47 |
Transcript nextPutAll: ' result = '. |
48 |
result isPetitFailure ifTrue:[ |
|
49 |
Transcript nextPutAll: 'FAILURE '. |
|
50 |
]. |
|
51 |
Transcript nextPutAll: result printString. |
|
52 |
Transcript cr. |
|
53 |
||
54 |
"Created: / 12-03-2012 / 16:41:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
127 | 55 |
"Modified: / 11-01-2013 / 15:17:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
75 | 56 |
! ! |
57 |
||
58 |
!PPDebugger methodsFor:'initialization'! |
|
59 |
||
60 |
initialize |
|
61 |
"Invoked when a new instance is created." |
|
62 |
||
63 |
"/ please change as required (and remove this comment) |
|
64 |
indent := 0. |
|
65 |
||
66 |
"/ super initialize. -- commented since inherited method does nothing |
|
67 |
||
68 |
"Modified: / 12-03-2012 / 16:41:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
69 |
! ! |
|
70 |
||
71 |
!PPDebugger class methodsFor:'documentation'! |
|
72 |
||
73 |
version |
|
127 | 74 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/devtools/PPDebugger.st,v 1.2 2013-01-11 15:17:28 vrany Exp $' |
75 | 75 |
! |
76 |
||
77 |
version_CVS |
|
127 | 78 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/devtools/PPDebugger.st,v 1.2 2013-01-11 15:17:28 vrany Exp $' |
75 | 79 |
! |
80 |
||
81 |
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:
127
diff
changeset
|
82 |
^ '§Id: PPDebugger.st 10 2012-05-04 18:54:13Z vranyj1 §' |
75 | 83 |
! ! |