-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeta.js
56 lines (40 loc) · 990 Bytes
/
meta.js
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
42
43
44
45
46
47
48
var _splice={
parse:function(){
return splice.parse.apply(splice,arguments)}}
var _quote={
parse:function(){
return quote.parse.apply(quote,arguments)}}
module.exports={
splice:_splice,
quote:_quote}
var expr=require("./expr").expr
var _=require("./stat")
var block=_.block,stat=_.stat
var gg=require("no/gg").gg
var splice=
gg.choice(
[gg.seq(
[",{",expr,"}"],
{builder:function(ee){
return ["Splice",ee[0]]}}),
gg.seq(
[",{",stat,"}"],
{builder:function(ee){
return ["Splice",ee[0]]}}),
gg.seq(
[",{",block,"}"],
{builder:function(ee){
return ["Splice",ee[0]]}})])
var quote=gg.choice(
[gg.seq(
["`{",expr,"}"],
{builder:function(ee){
return ["Quote",ee[0]]}}),
gg.seq(
["`{",stat,"}"],
{builder:function(ee){
return ["Quote",ee[0]]}}),
gg.seq(
["`{",block,"}"],
{builder:function(ee){
return ["Quote",["Block",ee[0]]]}})])