diff --git a/lexers/testdata/turing.actual b/lexers/testdata/turing.actual new file mode 100644 index 0000000..1280240 --- /dev/null +++ b/lexers/testdata/turing.actual @@ -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) \ No newline at end of file diff --git a/lexers/testdata/turing.expected b/lexers/testdata/turing.expected new file mode 100644 index 0000000..c96fc2f --- /dev/null +++ b/lexers/testdata/turing.expected @@ -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":")"} +]