Última actividad 7 hours ago

An example of V2's intermediate representation.

june's Avatar june revisó este gist 7 hours ago. Ir a la revisión

1 file changed, 12 insertions, 7 deletions

v2.json

@@ -21,16 +21,21 @@
21 21 "label": "another rule group",
22 22 "pattern": [
23 23 {
24 - "type": "variable",
25 - "symbol": "foo"
26 - },
27 - {
28 - "type": "literal",
29 - "symbol": "bar"
24 + "stack": "foo",
25 + "pattern": [
26 + {
27 + "type": "variable",
28 + "symbol": "foo"
29 + },
30 + {
31 + "type": "literal",
32 + "symbol": "bar"
33 + }
34 + ]
30 35 }
31 36 ]
32 37 }
33 38 ]
34 39 }
35 40 ]
36 - }
41 + }

june's Avatar june revisó este gist 13 hours ago. Ir a la revisión

1 file changed, 34 insertions, 32 deletions

v2.json

@@ -1,34 +1,36 @@
1 1 {
2 - "foo": {
3 - "conditions": [
4 - {
5 - "stack": "bar",
6 - "pattern": [
7 - {
8 - "type": "variable",
9 - "symbol": "baz"
10 - },
11 - {
12 - "type": "literal",
13 - "symbol": "quux"
14 - }
15 - ]
16 - }
17 - ],
18 - "results": [
19 - {
20 - "label": "another rule group",
21 - "pattern": [
22 - {
23 - "type": "variable",
24 - "symbol": "foo"
25 - },
26 - {
27 - "type": "literal",
28 - "symbol": "bar"
29 - }
30 - ]
31 - }
32 - ]
33 - }
2 + "foo": [
3 + {
4 + "conditions": [
5 + {
6 + "stack": "bar",
7 + "pattern": [
8 + {
9 + "type": "variable",
10 + "symbol": "baz"
11 + },
12 + {
13 + "type": "literal",
14 + "symbol": "quux"
15 + }
16 + ]
17 + }
18 + ],
19 + "results": [
20 + {
21 + "label": "another rule group",
22 + "pattern": [
23 + {
24 + "type": "variable",
25 + "symbol": "foo"
26 + },
27 + {
28 + "type": "literal",
29 + "symbol": "bar"
30 + }
31 + ]
32 + }
33 + ]
34 + }
35 + ]
34 36 }

june's Avatar june revisó este gist 13 hours ago. Ir a la revisión

1 file changed, 9 insertions, 9 deletions

v2.json

@@ -2,33 +2,33 @@
2 2 "foo": {
3 3 "conditions": [
4 4 {
5 - "stack": "bar",
5 + "stack": "bar",
6 6 "pattern": [
7 7 {
8 - "type": "variable",
8 + "type": "variable",
9 9 "symbol": "baz"
10 10 },
11 11 {
12 - "type": "literal",
12 + "type": "literal",
13 13 "symbol": "quux"
14 14 }
15 15 ]
16 16 }
17 17 ],
18 - "results": [
18 + "results": [
19 19 {
20 - "label": "another rule group",
20 + "label": "another rule group",
21 21 "pattern": [
22 22 {
23 - "type": "variable",
23 + "type": "variable",
24 24 "symbol": "foo"
25 25 },
26 26 {
27 - "type": "literal",
27 + "type": "literal",
28 28 "symbol": "bar"
29 29 }
30 30 ]
31 31 }
32 - ]
32 + ]
33 33 }
34 - }
34 + }

june's Avatar june revisó este gist 13 hours ago. Ir a la revisión

1 file changed, 3 insertions, 3 deletions

v2.json

@@ -14,8 +14,8 @@
14 14 }
15 15 ]
16 16 }
17 - ],
18 - "results": [
17 + ],
18 + "results": [
19 19 {
20 20 "label": "another rule group",
21 21 "pattern": [
@@ -29,6 +29,6 @@
29 29 }
30 30 ]
31 31 }
32 - ]
32 + ]
33 33 }
34 34 }

june's Avatar june revisó este gist 13 hours ago. Ir a la revisión

1 file changed, 34 insertions

v2.json(archivo creado)

@@ -0,0 +1,34 @@
1 + {
2 + "foo": {
3 + "conditions": [
4 + {
5 + "stack": "bar",
6 + "pattern": [
7 + {
8 + "type": "variable",
9 + "symbol": "baz"
10 + },
11 + {
12 + "type": "literal",
13 + "symbol": "quux"
14 + }
15 + ]
16 + }
17 + ],
18 + "results": [
19 + {
20 + "label": "another rule group",
21 + "pattern": [
22 + {
23 + "type": "variable",
24 + "symbol": "foo"
25 + },
26 + {
27 + "type": "literal",
28 + "symbol": "bar"
29 + }
30 + ]
31 + }
32 + ]
33 + }
34 + }
Siguiente Anterior