From 8535ee80ebccb81cebd61d1f33992aaf682e455a Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sat, 5 Aug 2023 21:16:28 -0400 Subject: Test file for basic token parsing --- tnslc/tests/simple/tokens.tnsl | 119 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 tnslc/tests/simple/tokens.tnsl diff --git a/tnslc/tests/simple/tokens.tnsl b/tnslc/tests/simple/tokens.tnsl new file mode 100644 index 0000000..f305b55 --- /dev/null +++ b/tnslc/tests/simple/tokens.tnsl @@ -0,0 +1,119 @@ +# This file meant as a test suite for tokenizers of the language. +# Obviously these lines should not appear, as they are comments + +# Each actual line will have a comment before it, showing what type of +# token the tokenizer should output. This file is non-exhaustive, but +# should represent a variety of cases. + +# Delimiter, delimiter +/;;/ + +# Delimiter +/;#;/ + +# All of the following should register as augment +~ +` +! +% +& +&& +* +- ++ += +== +!== +| +|| +/ +? +> +< +<== +>== +!< +!> +^ +^^ +!& +!| +!^ + +# Literals +0.0 +1 +4 +2 +"1" +" +String with new lines +" +'\'' +"\"" +"\\\"" +'\\' + +# might be changed, but for now will output augment, literal +.0 + +# Should be three delimiters +/; +;; +;/ + +# Keywords +if +else +loop +continue +break +return +method +struct +enum +interface +export +module +const +static +volatile +raw +extends +override +asm + +# Built-in Types + +uint8 +uint16 +uint32 +uint64 +uint +int8 +int16 +int32 +int64 +int +float32 +float64 +float +bool +type +void + +# optional +comp64 +comp +vect + +# separators +; +: +, + +# main function example + +/; main(int argc, ~~uint8 argv)[int] + return 0 +;/ \ No newline at end of file -- cgit v1.2.3