-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
41 lines (30 loc) · 798 Bytes
/
main.js
File metadata and controls
41 lines (30 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
let parse = require("./parser.js");
/*
console.log(JSON.stringify(operatorExpr(`
# test code
# comments will be ignored
line1 = asdf * sa + a / b
# equal signs are left associative,
# others are right associative
line2 = a = b:c|d e + f g h
line3 && true
# for more info, look at operators.js
`,0)));
console.log(JSON.stringify(operatorExpr(`
line1 = a $(b:(c*ww)) (++d):e++ # works
line1 = a $(b:(c*ww)) ++d:e++ # what
`,0)));
console.log(JSON.stringify(operatorExpr(`
++i.what
`,0)));
*/
console.log(JSON.stringify(parse(`
a+b`,0),null,4));
console.log(JSON.stringify(parse(`
asdf (select user : name == lemon | echo,d*e+f) (9)
`,0),null,4));
module.exports = {
parse:function(str){
return parse(str,0);
}
};