mirror of
https://github.com/alecthomas/chroma.git
synced 2025-03-17 20:58:08 +02:00
Add Turing tests
This commit is contained in:
parent
243dad6e5b
commit
f4dea84888
7
lexers/testdata/turing.actual
vendored
Normal file
7
lexers/testdata/turing.actual
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
var x : int := 10
|
||||
|
||||
fcn testFunction(a, b, c)
|
||||
result (a + b) * c
|
||||
end testFunction
|
||||
|
||||
put testFunction(x, 2 * x, 3)
|
61
lexers/testdata/turing.expected
vendored
Normal file
61
lexers/testdata/turing.expected
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
[
|
||||
{"type":"KeywordDeclaration","value":"var"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameOther","value":"x"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Punctuation","value":":"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"KeywordType","value":"int"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":":="},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"10"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"KeywordDeclaration","value":"fcn"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameOther","value":"testFunction"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"NameOther","value":"a"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameOther","value":"b"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameOther","value":"c"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":"\n "},
|
||||
{"type":"Keyword","value":"result"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"NameOther","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"+"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameOther","value":"b"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"*"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameOther","value":"c"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"KeywordDeclaration","value":"end"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameOther","value":"testFunction"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Keyword","value":"put"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameOther","value":"testFunction"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"NameOther","value":"x"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"2"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"*"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameOther","value":"x"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"LiteralNumberInteger","value":"3"},
|
||||
{"type":"Punctuation","value":")"}
|
||||
]
|
Loading…
x
Reference in New Issue
Block a user