summaryrefslogtreecommitdiff
path: root/tests/lexers/cbmbas/example.txt
blob: 5814e610942ff8b0b75a23c5bca4a034ea217a1d (plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---input---
10 rem cbm basic v2 example
20 rem comment with keywords: for, data
30 dim a$(20)
35 rem the typical space efficient form of leaving spaces out:
40 fort=0to15:poke646,t:print"{revers on}     ";:next
50 geta$:ifa$=chr$(0):goto40
55 rem it is legal to omit the closing " on line end
60 print"{white}":print"bye...
70 end

---tokens---
'10'          Literal.Number.Float
' '           Text
'rem cbm basic v2 example\n' Comment.Single

'20'          Literal.Number.Float
' '           Text
'rem comment with keywords: for, data\n' Comment.Single

'30'          Literal.Number.Float
' '           Text
'dim'         Keyword.Declaration
' '           Text
'a$'          Name
'('           Punctuation
'20'          Literal.Number.Float
')'           Punctuation
'\n'          Text

'35'          Literal.Number.Float
' '           Text
'rem the typical space efficient form of leaving spaces out:\n' Comment.Single

'40'          Literal.Number.Float
' '           Text
'for'         Keyword.Reserved
't'           Name
'='           Operator
'0'           Literal.Number.Float
'to'          Keyword.Reserved
'15'          Literal.Number.Float
':'           Punctuation
'poke'        Keyword.Reserved
'646'         Literal.Number.Float
','           Punctuation
't'           Name
':'           Punctuation
'print'       Keyword.Reserved
'"{revers on}     "' Literal.String
';'           Punctuation
':'           Punctuation
'next'        Keyword.Reserved
'\n'          Text

'50'          Literal.Number.Float
' '           Text
'get'         Keyword.Reserved
'a$'          Name
':'           Punctuation
'if'          Keyword.Reserved
'a$'          Name
'='           Operator
'chr$'        Name.Builtin
'('           Punctuation
'0'           Literal.Number.Float
')'           Punctuation
':'           Punctuation
'goto'        Keyword.Reserved
'40'          Literal.Number.Float
'\n'          Text

'55'          Literal.Number.Float
' '           Text
'rem it is legal to omit the closing " on line end\n' Comment.Single

'60'          Literal.Number.Float
' '           Text
'print'       Keyword.Reserved
'"{white}"'   Literal.String
':'           Punctuation
'print'       Keyword.Reserved
'"bye...'     Literal.String
'\n'          Text

'70'          Literal.Number.Float
' '           Text
'end'         Keyword.Reserved
'\n'          Text