adding some lex tests

master
Jordan Orelli 10 years ago
parent c43d431a97
commit 734d72c9a8

@ -5,3 +5,30 @@
-0
0
+0
-.1
.1
+.1
-0.1
0.1
+0.1
-1.5
1.5
+1.5
-0e9
0e9
+0e9
-1.2e5
1.2e5
+1.2e5
-1.2e-5
1.2e-5
+1.2e-5
0xfacebeef
0723414

@ -4,3 +4,23 @@
{t_real_number -0}
{t_real_number 0}
{t_real_number +0}
{t_real_number -.1}
{t_real_number .1}
{t_real_number +.1}
{t_real_number -0.1}
{t_real_number 0.1}
{t_real_number +0.1}
{t_real_number -1.5}
{t_real_number 1.5}
{t_real_number +1.5}
{t_real_number -0e9}
{t_real_number 0e9}
{t_real_number +0e9}
{t_real_number -1.2e5}
{t_real_number 1.2e5}
{t_real_number +1.2e5}
{t_real_number -1.2e-5}
{t_real_number 1.2e-5}
{t_real_number +1.2e-5}
{t_real_number 0xfacebeef}
{t_real_number 0723414}

@ -0,0 +1,6 @@
-1+2i
-1-2i
1+2i
1-2i
+1+2i
+1-2i

@ -0,0 +1,12 @@
{t_real_number -1}
{t_imaginary_number +2i}
{t_real_number -1}
{t_imaginary_number -2i}
{t_real_number 1}
{t_imaginary_number +2i}
{t_real_number 1}
{t_imaginary_number -2i}
{t_real_number +1}
{t_imaginary_number +2i}
{t_real_number +1}
{t_imaginary_number -2i}

@ -0,0 +1,3 @@
"a string literal"
"a sring with \"escaped quotes\" in it"
"a string with 'single quotes' in it"

@ -0,0 +1,3 @@
{t_string a string literal}
{t_string a sring with "escaped quotes" in it}
{t_string a string with 'single quotes' in it}

@ -0,0 +1,8 @@
errant_name
no_value:
key: var_name
key: "string"

@ -0,0 +1,9 @@
{t_name errant_name}
{t_name no_value}
{t_object_separator :}
{t_name key}
{t_object_separator :}
{t_name var_name}
{t_name key}
{t_object_separator :}
{t_string string}

@ -0,0 +1,4 @@
[]
[1 2 3]
["string one" "string two"]
[[1 2 3][]["string one" "string two"]]

@ -0,0 +1,24 @@
{t_list_start [}
{t_list_end ]}
{t_list_start [}
{t_real_number 1}
{t_real_number 2}
{t_real_number 3}
{t_list_end ]}
{t_list_start [}
{t_string string one}
{t_string string two}
{t_list_end ]}
{t_list_start [}
{t_list_start [}
{t_real_number 1}
{t_real_number 2}
{t_real_number 3}
{t_list_end ]}
{t_list_start [}
{t_list_end ]}
{t_list_start [}
{t_string string one}
{t_string string two}
{t_list_end ]}
{t_list_end ]}

@ -0,0 +1,11 @@
empty_object: {}
crazy_object: {
key: variable
key_two: "string here"
key_three: [1 2 3]
key_four: {
nested_one: "alright"
nested_two: [4 5 6]
}
}

@ -0,0 +1,35 @@
{t_name empty_object}
{t_object_separator :}
{t_object_start {}
{t_object_end }}
{t_name crazy_object}
{t_object_separator :}
{t_object_start {}
{t_name key}
{t_object_separator :}
{t_name variable}
{t_name key_two}
{t_object_separator :}
{t_string string here}
{t_name key_three}
{t_object_separator :}
{t_list_start [}
{t_real_number 1}
{t_real_number 2}
{t_real_number 3}
{t_list_end ]}
{t_name key_four}
{t_object_separator :}
{t_object_start {}
{t_name nested_one}
{t_object_separator :}
{t_string alright}
{t_name nested_two}
{t_object_separator :}
{t_list_start [}
{t_real_number 4}
{t_real_number 5}
{t_real_number 6}
{t_list_end ]}
{t_object_end }}
{t_object_end }}
Loading…
Cancel
Save