diff --git a/scripts/comments.rhai b/scripts/comments.rhai new file mode 100644 index 00000000..50f15278 --- /dev/null +++ b/scripts/comments.rhai @@ -0,0 +1,10 @@ +// I am a single line comment! + +let /* I am a spy in a variable declaration! */ x = 5; + +/* I am a simple + multiline comment */ + +/* look /* at /* that, /* multiline */ comments */ can be */ nested */ + +/* sorrounded by */ x // comments diff --git a/scripts/loop.rhai b/scripts/loop.rhai new file mode 100644 index 00000000..91b7a5d8 --- /dev/null +++ b/scripts/loop.rhai @@ -0,0 +1,8 @@ +let x = 10; + +// simulate do..while using loop +loop { + print(x); + x = x - 1; + if x <= 0 { break; } +}