File: parserInstructions.rst

package info (click to toggle)
cheetah 3.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,052 kB
  • sloc: python: 10,653; ansic: 584; xml: 323; sh: 181; makefile: 87
file content (64 lines) | stat: -rw-r--r-- 791 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Directives: Parser Instructions
===============================


#breakpoint
-----------


The template:

::

    Text before breakpoint.
    #breakpoint
    Text after breakpoint.
    #raise RuntimeError

The output:

::

    Text before breakpoint.

The generated code:

::

    write('Text before breakpoint.\n')

Nothing after the breakpoint was compiled.

#compiler
---------


The template:

::

    // Not a comment
    #compiler commentStartToken = '//'
    // A comment
    #compiler reset
    // Not a comment

The output:

::

    // Not a comment
    // Not a comment

The generated code:

::

    write('// Not a comment\n')
    #  A comment
    write('// Not a comment\n')

So this didn't affect the generated program, it just affected how
the template definition was read.