example.tb 815 Bytes
Newer Older
di68kap's avatar
di68kap committed
1
2
3
4
5
# Example for a Testbed. This example contains a few tests for the EBNF
# language



di68kap's avatar
di68kap committed
6
MATCH:literal
di68kap's avatar
di68kap committed
7

di68kap's avatar
di68kap committed
8
    standard  {"literal test double quoted"}
di68kap's avatar
di68kap committed
9

di68kap's avatar
di68kap committed
10
    {'literal test single suoted'}
di68kap's avatar
di68kap committed
11

di68kap's avatar
di68kap committed
12
13
14
    {'literal
      multiple lines
      with gap'}
di68kap's avatar
di68kap committed
15

di68kap's avatar
di68kap committed
16
17
    whitespaced
        {'literal with right-attached whitespace'   }
di68kap's avatar
di68kap committed
18

di68kap's avatar
di68kap committed
19
20

FAIL:literal
di68kap's avatar
di68kap committed
21
22
23
24
25
    {   'literal with left-attached whitespace'}
    {quotation marks forgotten}



di68kap's avatar
di68kap committed
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
MATCH:symbol

    standard {letters}
    {letters_with_underscore}
    {numbers_123}
    whitespaced {whitespace   }


FAIL:symbol

    {1_cannot_start_with_number}
    {   no_whitespace_on_the_left}
    {"with quotation marks it is a literal, not a symbol"}



MATCH:regexp

    standard {/\w+/}
    {/whitespace/   }
    whitespacemarker {~/\w+/~}
    right_wsp {/\w+/~}


MATCH:repetition
di68kap's avatar
di68kap committed
51

di68kap's avatar
di68kap committed
52
    [{ symbol }]