feat: regex for keywords, expect() to function as a parser
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// import somefoo
|
||||
//thisissomefoo
|
||||
main() {
|
||||
uint1 y = 1;
|
||||
uint8 x = 0;
|
||||
if x > 0 {
|
||||
print("Hello World, x is zero");
|
||||
} else {
|
||||
print("Hello World, x is %", x);
|
||||
}
|
||||
|
||||
while x < 10 {
|
||||
x++;
|
||||
}
|
||||
print("x is % now", x);
|
||||
|
||||
string file_path = "../examples/print.sr";
|
||||
fs.read(file_path);
|
||||
|
||||
|
||||
uint8[] x = [1,2,3];
|
||||
x.push(4);
|
||||
x.push(1);
|
||||
x.push(2);
|
||||
}
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
use foo;
|
||||
// comment
|
||||
main() {
|
||||
uint32 y = 1;
|
||||
uint y = 1;
|
||||
uint8 x = 0;
|
||||
if x > 0 {
|
||||
print("Hello World, x is zero");
|
||||
|
||||
Reference in New Issue
Block a user