1 | Scopes
|
2 | ======
|
3 |
|
4 | ```js
|
5 | const obj = { foo: 'Foo', bar: 'Bar' };
|
6 | ```
|
7 |
|
8 | ```js
|
9 | const obj = {
|
10 | foo: 'Foo',
|
11 | bar: 'Bar'
|
12 | };
|
13 | ```
|
14 |
|
15 |
|
16 | ```fire
|
17 | const obj = { foo: 'foo', bar: 'bar' }
|
18 | ```
|
19 |
|
20 | ```fire
|
21 | const obj = {
|
22 | foo: 'foo'
|
23 | bar: 'bar'
|
24 | }
|
25 | ```
|
26 |
|
27 | ```fire
|
28 | const obj =
|
29 | foo: 'foo'
|
30 | bar: 'bar'
|
31 |
|
32 | const obj =
|
33 | foo: 'foo'
|
34 | bar: 'bar' <- indention error
|
35 | ```
|
36 |
|
37 | * `{` or `{ + [indent]` or `[indent]`
|
38 | * foo
|
39 | * :
|
40 | * 'foo'
|
41 | * `,` or `[indent]`
|
42 | * bar
|
43 | * :
|
44 | * 'bar'
|
45 | * `}` or `[outdent] + }` or `[outdent]`
|
46 |
|
47 | walkScope(`}`)
|
48 | * break on `}`
|
49 | * split on `,` or `[indent]` or `, + [indent]`
|
50 | * on outdent throw indention error
|
51 |
|
52 | walkScope() <- first item sets scope indention
|
53 | * break on outdent
|
54 | * split on `,` or `[indent]` or `, + [indent]`
|
55 | * on indent throw indention error
|
56 | * higher indention throw indention error
|
57 |
|
58 | ---
|
59 |
|
60 | ### Call expression
|
61 |
|
62 | ```js
|
63 | foo('one', two)
|
64 | ```
|
65 |
|
66 | ```js
|
67 | foo(
|
68 | 'one',
|
69 | two
|
70 | )
|
71 |
|
72 | foo(
|
73 | 'one',
|
74 | two
|
75 | )
|
76 |
|
77 | foo(
|
78 | 'one',
|
79 | two
|
80 | )
|
81 | ```
|
82 |
|
83 | ```fire
|
84 | foo('one', two)
|
85 | ```
|
86 |
|
87 | ```fire
|
88 | foo(
|
89 | 'one'
|
90 | two
|
91 | )
|
92 |
|
93 | foo(
|
94 | 'one'
|
95 | two
|
96 | )
|
97 |
|
98 | foo(
|
99 | 'one'
|
100 | two
|
101 | )
|
102 |
|
103 | foo(
|
104 | 'one'
|
105 | two <- indention error or
|
106 | )
|
107 | ```
|
108 |
|
109 | ```fire
|
110 | do foo
|
111 | 'one'
|
112 | two
|
113 |
|
114 |
|
115 | do foo
|
116 | 'one' <- syntax error
|
117 | two
|
118 |
|
119 |
|
120 | do foo
|
121 | 'one'
|
122 | two
|
123 | ```
|
124 |
|
125 | * foo
|
126 | * `(` or `( + [indent]`
|
127 | * `one`
|
128 | * `,` or `[indent]` or `, + [indent]`
|
129 | * two
|
130 | * `)` or `[outdent]`
|
131 |
|
132 | walkScope(')')
|
133 | * break on ')'
|
134 | * on outdent throw indention error
|
135 | * split on `,` or `[indent]` or `, + [indent]`
|
136 |
|
137 | walkScope('') <- first item sets scope indention
|
138 | * break on ')'
|
139 | * on outdent throw indention error
|
140 | * split on `,` or `[indent]` or `, + [indent]`
|
141 | * higher indention throw indention error
|
142 |
|
\ | No newline at end of file |