diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2023-08-05 21:16:28 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2023-08-05 21:16:28 -0400 |
commit | 8535ee80ebccb81cebd61d1f33992aaf682e455a (patch) | |
tree | 84b47a67d9118284faa47bb8612963e4b8c51106 /tnslc/tests/simple/tokens.tnsl | |
parent | e070620bf7c66b4bdfeaa8e6bf96ca98fa9a1024 (diff) |
Test file for basic token parsing
Diffstat (limited to 'tnslc/tests/simple/tokens.tnsl')
-rw-r--r-- | tnslc/tests/simple/tokens.tnsl | 119 |
1 files changed, 119 insertions, 0 deletions
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 |