aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2024-06-14 17:55:51 +0200
committerBad Diode <bd@badd10de.dev>2024-06-14 17:55:51 +0200
commit3aae2f36047e9adc6a59b886492254eb4370777d (patch)
tree7d8f8fc069393dd38e9688d8d7cf77117ba5235f /tests
parentdeaf192df939c9ec9a62ef4febaf76ade0dcbb01 (diff)
downloadbdl-3aae2f36047e9adc6a59b886492254eb4370777d.tar.gz
bdl-3aae2f36047e9adc6a59b886492254eb4370777d.zip
Starting fresh with the `badlang`
Diffstat (limited to 'tests')
-rw-r--r--tests/literals.bad33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/literals.bad b/tests/literals.bad
new file mode 100644
index 0000000..673494d
--- /dev/null
+++ b/tests/literals.bad
@@ -0,0 +1,33 @@
1; String literals
2"this is a string literal"
3"" ; empty string literals
4"make sure ; can be used inside strings without issues"
5"\tmake sure to parse \"escape chars\" properly\n"
6"unicode 🥰 glyphs inside strings 😀"
7
8; Integers.
912345
10+420 ; ints can be positive
11-69 ; ... or negative
120b1101 ; we can write in binary form
130xff ; ... or hex (but not octal)
140014515 ; leading zeroes are allowed
151_000_000 ; we support separators
160xffff_ffff_ffff_ffff ; ... also on hex
170b1001_1111 ; ... and binary representations
18
19; Reals.
200.123
21+3.0 ; reals can be positive
22-1.3 ; ... or negative 1
232.45e5 ; we can use scientific notation
24+1.23e+6 ; +/- can be on the number and/or the exponent
25-3.14e-1 ; the exponents are always integers
26-3.21e+0xff ; ... in any of its forms
27
28; Booleans.
29true
30false
31
32; Nil.
33nil