liquidscript 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2630a75e954ba63bc5da7e92040fc2fce164236b
4
- data.tar.gz: 92fca33ae8fec68d082e16ba4431f873c8b251c0
3
+ metadata.gz: 68bfc5ecda69ab8e9d4cdd5ab3107f68242081e2
4
+ data.tar.gz: 446b8545df7906271047ceeaf477a54cd62b3eff
5
5
  SHA512:
6
- metadata.gz: 207d7676f032a4a00237f49c99d5feacb351ff7462b6354e240ce27e32d10f0eba5f787b116b2a91eed5893fe77d2f0754c8922dfda2867050ec7695cfa380ad
7
- data.tar.gz: 29c50870b4ed865a79ab1939b38b568353f65746ca9f3e73a6f1a01880d47f80463d1ba0e5706c9529aa56b1392d56efc19f2164db7b94b5ddecd1e4fa2469f6
6
+ metadata.gz: 5b357ea9b76443f45e46ded2ce820f30ec2e77bed463396a64be6ce0e0afdecdad320c3096415fc14f1c279f06c16a01ca93ba485ff94e4c63911c478d832347
7
+ data.tar.gz: 25d92be7391fd14fa8e2d2d757a53a44ccd46680567d520a7f4c44ce4fa3fbbcbcaa40f923f5397a54267f6cfdf52f40bbc096e36c384e2f5efe895e81b0232f
data/.gitignore CHANGED
@@ -15,4 +15,3 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
- lib/liquidscript/scanner/lexer.rb
@@ -0,0 +1,797 @@
1
+
2
+ # line 1 "lib/liquidscript/scanner/lexer.rl"
3
+
4
+ # line 56 "lib/liquidscript/scanner/lexer.rl"
5
+
6
+
7
+ module Liquidscript
8
+ class Scanner
9
+
10
+ # A lexer, built from ragel.
11
+ #
12
+ # @private
13
+ class Lexer
14
+
15
+ attr_reader :tokens
16
+
17
+ def initialize
18
+
19
+ # line 20 "lib/liquidscript/scanner/lexer.rb"
20
+ class << self
21
+ attr_accessor :_lexer_actions
22
+ private :_lexer_actions, :_lexer_actions=
23
+ end
24
+ self._lexer_actions = [
25
+ 0, 1, 0, 1, 1, 1, 2, 1,
26
+ 17, 1, 18, 1, 19, 1, 20, 1,
27
+ 21, 1, 22, 1, 23, 1, 24, 1,
28
+ 25, 1, 26, 1, 27, 1, 28, 1,
29
+ 29, 1, 30, 1, 31, 1, 32, 1,
30
+ 33, 1, 34, 1, 35, 1, 36, 1,
31
+ 37, 2, 2, 3, 2, 2, 4, 2,
32
+ 2, 5, 2, 2, 6, 2, 2, 7,
33
+ 2, 2, 8, 2, 2, 9, 2, 2,
34
+ 10, 2, 2, 11, 2, 2, 12, 2,
35
+ 2, 13, 2, 2, 14, 2, 2, 15,
36
+ 2, 2, 16
37
+ ]
38
+
39
+ class << self
40
+ attr_accessor :_lexer_key_offsets
41
+ private :_lexer_key_offsets, :_lexer_key_offsets=
42
+ end
43
+ self._lexer_key_offsets = [
44
+ 0, 2, 4, 6, 10, 12, 56, 57,
45
+ 58, 60, 68, 69, 78, 79, 83, 88,
46
+ 92, 94, 96, 98, 99, 108, 117, 126,
47
+ 135, 144, 153, 163, 172, 181, 190, 199,
48
+ 208, 218, 227, 236, 245, 254, 263, 272,
49
+ 281, 290, 299, 308, 317, 326, 335, 345,
50
+ 354, 363, 372, 381, 390, 399, 408, 417,
51
+ 427, 436, 445, 454, 463, 472, 481, 491,
52
+ 500, 509, 518, 527, 536, 545, 554, 563,
53
+ 572
54
+ ]
55
+
56
+ class << self
57
+ attr_accessor :_lexer_trans_keys
58
+ private :_lexer_trans_keys, :_lexer_trans_keys=
59
+ end
60
+ self._lexer_trans_keys = [
61
+ 34, 92, 34, 92, 48, 57, 43, 45,
62
+ 48, 57, 48, 57, 10, 32, 33, 34,
63
+ 36, 38, 39, 40, 41, 43, 44, 45,
64
+ 46, 58, 60, 61, 62, 91, 93, 94,
65
+ 95, 99, 101, 102, 105, 109, 110, 114,
66
+ 116, 117, 123, 124, 125, 126, 9, 13,
67
+ 42, 47, 48, 57, 65, 90, 97, 122,
68
+ 61, 61, 34, 92, 36, 95, 48, 57,
69
+ 65, 90, 97, 122, 38, 36, 45, 95,
70
+ 48, 57, 65, 90, 97, 122, 43, 45,
71
+ 62, 48, 57, 46, 69, 101, 49, 57,
72
+ 69, 101, 48, 57, 48, 57, 60, 61,
73
+ 61, 62, 62, 36, 95, 108, 48, 57,
74
+ 65, 90, 97, 122, 36, 95, 97, 48,
75
+ 57, 65, 90, 98, 122, 36, 95, 115,
76
+ 48, 57, 65, 90, 97, 122, 36, 95,
77
+ 115, 48, 57, 65, 90, 97, 122, 36,
78
+ 95, 108, 48, 57, 65, 90, 97, 122,
79
+ 36, 95, 115, 48, 57, 65, 90, 97,
80
+ 122, 36, 95, 101, 105, 48, 57, 65,
81
+ 90, 97, 122, 36, 95, 102, 48, 57,
82
+ 65, 90, 97, 122, 36, 95, 97, 48,
83
+ 57, 65, 90, 98, 122, 36, 95, 108,
84
+ 48, 57, 65, 90, 97, 122, 36, 95,
85
+ 115, 48, 57, 65, 90, 97, 122, 36,
86
+ 95, 101, 48, 57, 65, 90, 97, 122,
87
+ 36, 95, 102, 110, 48, 57, 65, 90,
88
+ 97, 122, 36, 95, 115, 48, 57, 65,
89
+ 90, 97, 122, 36, 95, 116, 48, 57,
90
+ 65, 90, 97, 122, 36, 95, 97, 48,
91
+ 57, 65, 90, 98, 122, 36, 95, 110,
92
+ 48, 57, 65, 90, 97, 122, 36, 95,
93
+ 99, 48, 57, 65, 90, 97, 122, 36,
94
+ 95, 101, 48, 57, 65, 90, 97, 122,
95
+ 36, 95, 111, 48, 57, 65, 90, 97,
96
+ 122, 36, 95, 102, 48, 57, 65, 90,
97
+ 97, 122, 36, 95, 111, 48, 57, 65,
98
+ 90, 97, 122, 36, 95, 100, 48, 57,
99
+ 65, 90, 97, 122, 36, 95, 117, 48,
100
+ 57, 65, 90, 97, 122, 36, 95, 108,
101
+ 48, 57, 65, 90, 97, 122, 36, 95,
102
+ 101, 48, 57, 65, 90, 97, 122, 36,
103
+ 95, 101, 117, 48, 57, 65, 90, 97,
104
+ 122, 36, 95, 119, 48, 57, 65, 90,
105
+ 97, 122, 36, 95, 108, 48, 57, 65,
106
+ 90, 97, 122, 36, 95, 108, 48, 57,
107
+ 65, 90, 97, 122, 36, 95, 101, 48,
108
+ 57, 65, 90, 97, 122, 36, 95, 116,
109
+ 48, 57, 65, 90, 97, 122, 36, 95,
110
+ 117, 48, 57, 65, 90, 97, 122, 36,
111
+ 95, 114, 48, 57, 65, 90, 97, 122,
112
+ 36, 95, 110, 48, 57, 65, 90, 97,
113
+ 122, 36, 95, 114, 121, 48, 57, 65,
114
+ 90, 97, 122, 36, 95, 117, 48, 57,
115
+ 65, 90, 97, 122, 36, 95, 112, 48,
116
+ 57, 65, 90, 97, 122, 36, 95, 101,
117
+ 48, 57, 65, 90, 97, 122, 36, 95,
118
+ 111, 48, 57, 65, 90, 97, 122, 36,
119
+ 95, 102, 48, 57, 65, 90, 97, 122,
120
+ 36, 95, 110, 48, 57, 65, 90, 97,
121
+ 122, 36, 95, 100, 108, 48, 57, 65,
122
+ 90, 97, 122, 36, 95, 101, 48, 57,
123
+ 65, 90, 97, 122, 36, 95, 102, 48,
124
+ 57, 65, 90, 97, 122, 36, 95, 105,
125
+ 48, 57, 65, 90, 97, 122, 36, 95,
126
+ 110, 48, 57, 65, 90, 97, 122, 36,
127
+ 95, 101, 48, 57, 65, 90, 97, 122,
128
+ 36, 95, 100, 48, 57, 65, 90, 97,
129
+ 122, 36, 95, 101, 48, 57, 65, 90,
130
+ 97, 122, 36, 95, 115, 48, 57, 65,
131
+ 90, 97, 122, 36, 95, 115, 48, 57,
132
+ 65, 90, 97, 122, 124, 0
133
+ ]
134
+
135
+ class << self
136
+ attr_accessor :_lexer_single_lengths
137
+ private :_lexer_single_lengths, :_lexer_single_lengths=
138
+ end
139
+ self._lexer_single_lengths = [
140
+ 2, 2, 0, 2, 0, 34, 1, 1,
141
+ 2, 2, 1, 3, 1, 2, 3, 2,
142
+ 0, 0, 2, 1, 3, 3, 3, 3,
143
+ 3, 3, 4, 3, 3, 3, 3, 3,
144
+ 4, 3, 3, 3, 3, 3, 3, 3,
145
+ 3, 3, 3, 3, 3, 3, 4, 3,
146
+ 3, 3, 3, 3, 3, 3, 3, 4,
147
+ 3, 3, 3, 3, 3, 3, 4, 3,
148
+ 3, 3, 3, 3, 3, 3, 3, 3,
149
+ 1
150
+ ]
151
+
152
+ class << self
153
+ attr_accessor :_lexer_range_lengths
154
+ private :_lexer_range_lengths, :_lexer_range_lengths=
155
+ end
156
+ self._lexer_range_lengths = [
157
+ 0, 0, 1, 1, 1, 5, 0, 0,
158
+ 0, 3, 0, 3, 0, 1, 1, 1,
159
+ 1, 1, 0, 0, 3, 3, 3, 3,
160
+ 3, 3, 3, 3, 3, 3, 3, 3,
161
+ 3, 3, 3, 3, 3, 3, 3, 3,
162
+ 3, 3, 3, 3, 3, 3, 3, 3,
163
+ 3, 3, 3, 3, 3, 3, 3, 3,
164
+ 3, 3, 3, 3, 3, 3, 3, 3,
165
+ 3, 3, 3, 3, 3, 3, 3, 3,
166
+ 0
167
+ ]
168
+
169
+ class << self
170
+ attr_accessor :_lexer_index_offsets
171
+ private :_lexer_index_offsets, :_lexer_index_offsets=
172
+ end
173
+ self._lexer_index_offsets = [
174
+ 0, 3, 6, 8, 12, 14, 54, 56,
175
+ 58, 61, 67, 69, 76, 78, 82, 87,
176
+ 91, 93, 95, 98, 100, 107, 114, 121,
177
+ 128, 135, 142, 150, 157, 164, 171, 178,
178
+ 185, 193, 200, 207, 214, 221, 228, 235,
179
+ 242, 249, 256, 263, 270, 277, 284, 292,
180
+ 299, 306, 313, 320, 327, 334, 341, 348,
181
+ 356, 363, 370, 377, 384, 391, 398, 406,
182
+ 413, 420, 427, 434, 441, 448, 455, 462,
183
+ 469
184
+ ]
185
+
186
+ class << self
187
+ attr_accessor :_lexer_indicies
188
+ private :_lexer_indicies, :_lexer_indicies=
189
+ end
190
+ self._lexer_indicies = [
191
+ 2, 3, 1, 4, 3, 1, 6, 5,
192
+ 7, 7, 8, 5, 8, 5, 11, 10,
193
+ 12, 13, 14, 15, 16, 17, 18, 20,
194
+ 21, 22, 23, 25, 26, 27, 28, 29,
195
+ 30, 19, 14, 31, 32, 33, 34, 35,
196
+ 36, 37, 38, 39, 40, 41, 42, 43,
197
+ 10, 19, 24, 14, 14, 9, 44, 0,
198
+ 19, 45, 2, 3, 1, 14, 14, 14,
199
+ 14, 14, 0, 19, 45, 46, 46, 46,
200
+ 46, 46, 46, 0, 43, 45, 43, 47,
201
+ 24, 45, 49, 50, 50, 24, 48, 50,
202
+ 50, 6, 48, 8, 48, 19, 45, 19,
203
+ 51, 45, 19, 45, 14, 14, 53, 14,
204
+ 14, 14, 52, 14, 14, 54, 14, 14,
205
+ 14, 52, 14, 14, 55, 14, 14, 14,
206
+ 52, 14, 14, 56, 14, 14, 14, 52,
207
+ 14, 14, 57, 14, 14, 14, 52, 14,
208
+ 14, 58, 14, 14, 14, 52, 14, 14,
209
+ 59, 60, 14, 14, 14, 52, 14, 14,
210
+ 61, 14, 14, 14, 52, 14, 14, 62,
211
+ 14, 14, 14, 52, 14, 14, 63, 14,
212
+ 14, 14, 52, 14, 14, 64, 14, 14,
213
+ 14, 52, 14, 14, 65, 14, 14, 14,
214
+ 52, 14, 14, 66, 67, 14, 14, 14,
215
+ 52, 14, 14, 68, 14, 14, 14, 52,
216
+ 14, 14, 69, 14, 14, 14, 52, 14,
217
+ 14, 70, 14, 14, 14, 52, 14, 14,
218
+ 71, 14, 14, 14, 52, 14, 14, 72,
219
+ 14, 14, 14, 52, 14, 14, 73, 14,
220
+ 14, 14, 52, 14, 14, 74, 14, 14,
221
+ 14, 52, 14, 14, 75, 14, 14, 14,
222
+ 52, 14, 14, 76, 14, 14, 14, 52,
223
+ 14, 14, 77, 14, 14, 14, 52, 14,
224
+ 14, 78, 14, 14, 14, 52, 14, 14,
225
+ 79, 14, 14, 14, 52, 14, 14, 80,
226
+ 14, 14, 14, 52, 14, 14, 81, 82,
227
+ 14, 14, 14, 52, 14, 14, 83, 14,
228
+ 14, 14, 52, 14, 14, 84, 14, 14,
229
+ 14, 52, 14, 14, 65, 14, 14, 14,
230
+ 52, 14, 14, 85, 14, 14, 14, 52,
231
+ 14, 14, 86, 14, 14, 14, 52, 14,
232
+ 14, 87, 14, 14, 14, 52, 14, 14,
233
+ 88, 14, 14, 14, 52, 14, 14, 83,
234
+ 14, 14, 14, 52, 14, 14, 89, 90,
235
+ 14, 14, 14, 52, 14, 14, 64, 14,
236
+ 14, 14, 52, 14, 14, 91, 14, 14,
237
+ 14, 52, 14, 14, 92, 14, 14, 14,
238
+ 52, 14, 14, 93, 14, 14, 14, 52,
239
+ 14, 14, 83, 14, 14, 14, 52, 14,
240
+ 14, 94, 14, 14, 14, 52, 14, 14,
241
+ 95, 96, 14, 14, 14, 52, 14, 14,
242
+ 97, 14, 14, 14, 52, 14, 14, 98,
243
+ 14, 14, 14, 52, 14, 14, 99, 14,
244
+ 14, 14, 52, 14, 14, 100, 14, 14,
245
+ 14, 52, 14, 14, 101, 14, 14, 14,
246
+ 52, 14, 14, 65, 14, 14, 14, 52,
247
+ 14, 14, 102, 14, 14, 14, 52, 14,
248
+ 14, 103, 14, 14, 14, 52, 14, 14,
249
+ 104, 14, 14, 14, 52, 19, 45, 0
250
+ ]
251
+
252
+ class << self
253
+ attr_accessor :_lexer_trans_targs
254
+ private :_lexer_trans_targs, :_lexer_trans_targs=
255
+ end
256
+ self._lexer_trans_targs = [
257
+ 5, 0, 5, 1, 8, 5, 15, 4,
258
+ 16, 5, 5, 5, 6, 8, 9, 10,
259
+ 11, 5, 5, 5, 12, 5, 13, 5,
260
+ 14, 5, 17, 6, 18, 5, 5, 20,
261
+ 24, 28, 32, 41, 46, 50, 55, 61,
262
+ 5, 72, 5, 5, 7, 5, 11, 5,
263
+ 5, 2, 3, 19, 5, 21, 22, 23,
264
+ 9, 25, 26, 9, 27, 9, 29, 30,
265
+ 31, 9, 9, 33, 34, 35, 36, 37,
266
+ 38, 39, 40, 9, 42, 43, 44, 45,
267
+ 9, 47, 48, 9, 49, 51, 52, 53,
268
+ 54, 56, 57, 58, 59, 60, 62, 63,
269
+ 69, 64, 65, 66, 67, 68, 70, 71,
270
+ 9
271
+ ]
272
+
273
+ class << self
274
+ attr_accessor :_lexer_trans_actions
275
+ private :_lexer_trans_actions, :_lexer_trans_actions=
276
+ end
277
+ self._lexer_trans_actions = [
278
+ 47, 0, 7, 0, 49, 45, 5, 0,
279
+ 0, 37, 35, 33, 73, 88, 82, 0,
280
+ 88, 17, 23, 11, 0, 31, 0, 29,
281
+ 5, 27, 0, 85, 0, 19, 25, 0,
282
+ 0, 0, 0, 0, 0, 0, 0, 0,
283
+ 15, 0, 21, 9, 0, 41, 52, 13,
284
+ 39, 0, 0, 0, 43, 0, 0, 0,
285
+ 55, 0, 0, 70, 0, 67, 0, 0,
286
+ 0, 79, 61, 0, 0, 0, 0, 0,
287
+ 0, 0, 0, 76, 0, 0, 0, 0,
288
+ 58, 0, 0, 73, 0, 0, 0, 0,
289
+ 0, 0, 0, 0, 0, 0, 0, 0,
290
+ 0, 0, 0, 0, 0, 0, 0, 0,
291
+ 64
292
+ ]
293
+
294
+ class << self
295
+ attr_accessor :_lexer_to_state_actions
296
+ private :_lexer_to_state_actions, :_lexer_to_state_actions=
297
+ end
298
+ self._lexer_to_state_actions = [
299
+ 0, 0, 0, 0, 0, 1, 0, 0,
300
+ 0, 0, 0, 0, 0, 0, 0, 0,
301
+ 0, 0, 0, 0, 0, 0, 0, 0,
302
+ 0, 0, 0, 0, 0, 0, 0, 0,
303
+ 0, 0, 0, 0, 0, 0, 0, 0,
304
+ 0, 0, 0, 0, 0, 0, 0, 0,
305
+ 0, 0, 0, 0, 0, 0, 0, 0,
306
+ 0, 0, 0, 0, 0, 0, 0, 0,
307
+ 0, 0, 0, 0, 0, 0, 0, 0,
308
+ 0
309
+ ]
310
+
311
+ class << self
312
+ attr_accessor :_lexer_from_state_actions
313
+ private :_lexer_from_state_actions, :_lexer_from_state_actions=
314
+ end
315
+ self._lexer_from_state_actions = [
316
+ 0, 0, 0, 0, 0, 3, 0, 0,
317
+ 0, 0, 0, 0, 0, 0, 0, 0,
318
+ 0, 0, 0, 0, 0, 0, 0, 0,
319
+ 0, 0, 0, 0, 0, 0, 0, 0,
320
+ 0, 0, 0, 0, 0, 0, 0, 0,
321
+ 0, 0, 0, 0, 0, 0, 0, 0,
322
+ 0, 0, 0, 0, 0, 0, 0, 0,
323
+ 0, 0, 0, 0, 0, 0, 0, 0,
324
+ 0, 0, 0, 0, 0, 0, 0, 0,
325
+ 0
326
+ ]
327
+
328
+ class << self
329
+ attr_accessor :_lexer_eof_trans
330
+ private :_lexer_eof_trans, :_lexer_eof_trans=
331
+ end
332
+ self._lexer_eof_trans = [
333
+ 1, 1, 6, 6, 6, 0, 1, 46,
334
+ 1, 1, 46, 1, 46, 46, 49, 49,
335
+ 49, 46, 46, 46, 53, 53, 53, 53,
336
+ 53, 53, 53, 53, 53, 53, 53, 53,
337
+ 53, 53, 53, 53, 53, 53, 53, 53,
338
+ 53, 53, 53, 53, 53, 53, 53, 53,
339
+ 53, 53, 53, 53, 53, 53, 53, 53,
340
+ 53, 53, 53, 53, 53, 53, 53, 53,
341
+ 53, 53, 53, 53, 53, 53, 53, 53,
342
+ 46
343
+ ]
344
+
345
+ class << self
346
+ attr_accessor :lexer_start
347
+ end
348
+ self.lexer_start = 5;
349
+ class << self
350
+ attr_accessor :lexer_first_final
351
+ end
352
+ self.lexer_first_final = 5;
353
+ class << self
354
+ attr_accessor :lexer_error
355
+ end
356
+ self.lexer_error = -1;
357
+
358
+ class << self
359
+ attr_accessor :lexer_en_main
360
+ end
361
+ self.lexer_en_main = 5;
362
+
363
+
364
+ # line 70 "lib/liquidscript/scanner/lexer.rl"
365
+ # %% # fix
366
+ @tokens = []
367
+ clean!
368
+ end
369
+
370
+ def clean!
371
+ @p = nil
372
+ @pe = nil
373
+ @te = nil
374
+ @ts = nil
375
+ @act = nil
376
+ @eof = nil
377
+ @top = nil
378
+ @line = { :start => 0, :num => 0 }
379
+ @data = nil
380
+ @stack = nil
381
+ end
382
+
383
+ def emit(type)
384
+ @tokens << Token.new(type, @data[@ts..(@te - 1)],
385
+ @line[:num], @ts - @line[:start])
386
+ end
387
+
388
+ def error
389
+ raise SyntaxError, "Unexpected #{@data[@ts..(@te-1)].pack('c*')}"
390
+ end
391
+
392
+ def perform(data)
393
+ @data = data.unpack("c*") if data.is_a? String
394
+ @eof = data.length
395
+
396
+ @tokens = []
397
+
398
+ line = proc do
399
+ @line[:start] = @ts
400
+ @line[:num] += 1
401
+ end
402
+
403
+
404
+ # line 405 "lib/liquidscript/scanner/lexer.rb"
405
+ begin
406
+ @p ||= 0
407
+ @pe ||= @data.length
408
+ @cs = lexer_start
409
+ @ts = nil
410
+ @te = nil
411
+ @act = 0
412
+ end
413
+
414
+ # line 109 "lib/liquidscript/scanner/lexer.rl"
415
+
416
+ # line 417 "lib/liquidscript/scanner/lexer.rb"
417
+ begin
418
+ _klen, _trans, _keys, _acts, _nacts = nil
419
+ _goto_level = 0
420
+ _resume = 10
421
+ _eof_trans = 15
422
+ _again = 20
423
+ _test_eof = 30
424
+ _out = 40
425
+ while true
426
+ _trigger_goto = false
427
+ if _goto_level <= 0
428
+ if @p == @pe
429
+ _goto_level = _test_eof
430
+ next
431
+ end
432
+ end
433
+ if _goto_level <= _resume
434
+ _acts = _lexer_from_state_actions[ @cs]
435
+ _nacts = _lexer_actions[_acts]
436
+ _acts += 1
437
+ while _nacts > 0
438
+ _nacts -= 1
439
+ _acts += 1
440
+ case _lexer_actions[_acts - 1]
441
+ when 1 then
442
+ # line 1 "NONE"
443
+ begin
444
+ @ts = @p
445
+ end
446
+ # line 447 "lib/liquidscript/scanner/lexer.rb"
447
+ end # from state action switch
448
+ end
449
+ if _trigger_goto
450
+ next
451
+ end
452
+ _keys = _lexer_key_offsets[ @cs]
453
+ _trans = _lexer_index_offsets[ @cs]
454
+ _klen = _lexer_single_lengths[ @cs]
455
+ _break_match = false
456
+
457
+ begin
458
+ if _klen > 0
459
+ _lower = _keys
460
+ _upper = _keys + _klen - 1
461
+
462
+ loop do
463
+ break if _upper < _lower
464
+ _mid = _lower + ( (_upper - _lower) >> 1 )
465
+
466
+ if @data[ @p].ord < _lexer_trans_keys[_mid]
467
+ _upper = _mid - 1
468
+ elsif @data[ @p].ord > _lexer_trans_keys[_mid]
469
+ _lower = _mid + 1
470
+ else
471
+ _trans += (_mid - _keys)
472
+ _break_match = true
473
+ break
474
+ end
475
+ end # loop
476
+ break if _break_match
477
+ _keys += _klen
478
+ _trans += _klen
479
+ end
480
+ _klen = _lexer_range_lengths[ @cs]
481
+ if _klen > 0
482
+ _lower = _keys
483
+ _upper = _keys + (_klen << 1) - 2
484
+ loop do
485
+ break if _upper < _lower
486
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1)
487
+ if @data[ @p].ord < _lexer_trans_keys[_mid]
488
+ _upper = _mid - 2
489
+ elsif @data[ @p].ord > _lexer_trans_keys[_mid+1]
490
+ _lower = _mid + 2
491
+ else
492
+ _trans += ((_mid - _keys) >> 1)
493
+ _break_match = true
494
+ break
495
+ end
496
+ end # loop
497
+ break if _break_match
498
+ _trans += _klen
499
+ end
500
+ end while false
501
+ _trans = _lexer_indicies[_trans]
502
+ end
503
+ if _goto_level <= _eof_trans
504
+ @cs = _lexer_trans_targs[_trans]
505
+ if _lexer_trans_actions[_trans] != 0
506
+ _acts = _lexer_trans_actions[_trans]
507
+ _nacts = _lexer_actions[_acts]
508
+ _acts += 1
509
+ while _nacts > 0
510
+ _nacts -= 1
511
+ _acts += 1
512
+ case _lexer_actions[_acts - 1]
513
+ when 2 then
514
+ # line 1 "NONE"
515
+ begin
516
+ @te = @p+1
517
+ end
518
+ when 3 then
519
+ # line 29 "lib/liquidscript/scanner/lexer.rl"
520
+ begin
521
+ @act = 2; end
522
+ when 4 then
523
+ # line 30 "lib/liquidscript/scanner/lexer.rl"
524
+ begin
525
+ @act = 3; end
526
+ when 5 then
527
+ # line 31 "lib/liquidscript/scanner/lexer.rl"
528
+ begin
529
+ @act = 4; end
530
+ when 6 then
531
+ # line 32 "lib/liquidscript/scanner/lexer.rl"
532
+ begin
533
+ @act = 5; end
534
+ when 7 then
535
+ # line 33 "lib/liquidscript/scanner/lexer.rl"
536
+ begin
537
+ @act = 6; end
538
+ when 8 then
539
+ # line 34 "lib/liquidscript/scanner/lexer.rl"
540
+ begin
541
+ @act = 7; end
542
+ when 9 then
543
+ # line 35 "lib/liquidscript/scanner/lexer.rl"
544
+ begin
545
+ @act = 8; end
546
+ when 10 then
547
+ # line 36 "lib/liquidscript/scanner/lexer.rl"
548
+ begin
549
+ @act = 9; end
550
+ when 11 then
551
+ # line 37 "lib/liquidscript/scanner/lexer.rl"
552
+ begin
553
+ @act = 10; end
554
+ when 12 then
555
+ # line 38 "lib/liquidscript/scanner/lexer.rl"
556
+ begin
557
+ @act = 11; end
558
+ when 13 then
559
+ # line 39 "lib/liquidscript/scanner/lexer.rl"
560
+ begin
561
+ @act = 12; end
562
+ when 14 then
563
+ # line 40 "lib/liquidscript/scanner/lexer.rl"
564
+ begin
565
+ @act = 13; end
566
+ when 15 then
567
+ # line 42 "lib/liquidscript/scanner/lexer.rl"
568
+ begin
569
+ @act = 15; end
570
+ when 16 then
571
+ # line 54 "lib/liquidscript/scanner/lexer.rl"
572
+ begin
573
+ @act = 27; end
574
+ when 17 then
575
+ # line 29 "lib/liquidscript/scanner/lexer.rl"
576
+ begin
577
+ @te = @p+1
578
+ begin emit :dstring end
579
+ end
580
+ when 18 then
581
+ # line 37 "lib/liquidscript/scanner/lexer.rl"
582
+ begin
583
+ @te = @p+1
584
+ begin emit :unop end
585
+ end
586
+ when 19 then
587
+ # line 38 "lib/liquidscript/scanner/lexer.rl"
588
+ begin
589
+ @te = @p+1
590
+ begin emit :binop end
591
+ end
592
+ when 20 then
593
+ # line 41 "lib/liquidscript/scanner/lexer.rl"
594
+ begin
595
+ @te = @p+1
596
+ begin emit :arrow end
597
+ end
598
+ when 21 then
599
+ # line 43 "lib/liquidscript/scanner/lexer.rl"
600
+ begin
601
+ @te = @p+1
602
+ begin emit :lbrack end
603
+ end
604
+ when 22 then
605
+ # line 44 "lib/liquidscript/scanner/lexer.rl"
606
+ begin
607
+ @te = @p+1
608
+ begin emit :lparen end
609
+ end
610
+ when 23 then
611
+ # line 45 "lib/liquidscript/scanner/lexer.rl"
612
+ begin
613
+ @te = @p+1
614
+ begin emit :lbrace end
615
+ end
616
+ when 24 then
617
+ # line 46 "lib/liquidscript/scanner/lexer.rl"
618
+ begin
619
+ @te = @p+1
620
+ begin emit :rbrack end
621
+ end
622
+ when 25 then
623
+ # line 47 "lib/liquidscript/scanner/lexer.rl"
624
+ begin
625
+ @te = @p+1
626
+ begin emit :rparen end
627
+ end
628
+ when 26 then
629
+ # line 48 "lib/liquidscript/scanner/lexer.rl"
630
+ begin
631
+ @te = @p+1
632
+ begin emit :rbrace end
633
+ end
634
+ when 27 then
635
+ # line 49 "lib/liquidscript/scanner/lexer.rl"
636
+ begin
637
+ @te = @p+1
638
+ begin emit :colon end
639
+ end
640
+ when 28 then
641
+ # line 50 "lib/liquidscript/scanner/lexer.rl"
642
+ begin
643
+ @te = @p+1
644
+ begin emit :prop end
645
+ end
646
+ when 29 then
647
+ # line 51 "lib/liquidscript/scanner/lexer.rl"
648
+ begin
649
+ @te = @p+1
650
+ begin emit :comma end
651
+ end
652
+ when 30 then
653
+ # line 52 "lib/liquidscript/scanner/lexer.rl"
654
+ begin
655
+ @te = @p+1
656
+ begin line.call end
657
+ end
658
+ when 31 then
659
+ # line 53 "lib/liquidscript/scanner/lexer.rl"
660
+ begin
661
+ @te = @p+1
662
+ begin end
663
+ end
664
+ when 32 then
665
+ # line 54 "lib/liquidscript/scanner/lexer.rl"
666
+ begin
667
+ @te = @p+1
668
+ begin error end
669
+ end
670
+ when 33 then
671
+ # line 28 "lib/liquidscript/scanner/lexer.rl"
672
+ begin
673
+ @te = @p
674
+ @p = @p - 1; begin emit :number end
675
+ end
676
+ when 34 then
677
+ # line 38 "lib/liquidscript/scanner/lexer.rl"
678
+ begin
679
+ @te = @p
680
+ @p = @p - 1; begin emit :binop end
681
+ end
682
+ when 35 then
683
+ # line 40 "lib/liquidscript/scanner/lexer.rl"
684
+ begin
685
+ @te = @p
686
+ @p = @p - 1; begin emit :identifier end
687
+ end
688
+ when 36 then
689
+ # line 28 "lib/liquidscript/scanner/lexer.rl"
690
+ begin
691
+ begin @p = (( @te))-1; end
692
+ begin emit :number end
693
+ end
694
+ when 37 then
695
+ # line 1 "NONE"
696
+ begin
697
+ case @act
698
+ when 2 then
699
+ begin begin @p = (( @te))-1; end
700
+ emit :dstring end
701
+ when 3 then
702
+ begin begin @p = (( @te))-1; end
703
+ emit :sstring end
704
+ when 4 then
705
+ begin begin @p = (( @te))-1; end
706
+ emit :class end
707
+ when 5 then
708
+ begin begin @p = (( @te))-1; end
709
+ emit :module end
710
+ when 6 then
711
+ begin begin @p = (( @te))-1; end
712
+ emit :if end
713
+ when 7 then
714
+ begin begin @p = (( @te))-1; end
715
+ emit :unless end
716
+ when 8 then
717
+ begin begin @p = (( @te))-1; end
718
+ emit :elsif end
719
+ when 9 then
720
+ begin begin @p = (( @te))-1; end
721
+ emit :else end
722
+ when 10 then
723
+ begin begin @p = (( @te))-1; end
724
+ emit :unop end
725
+ when 11 then
726
+ begin begin @p = (( @te))-1; end
727
+ emit :binop end
728
+ when 12 then
729
+ begin begin @p = (( @te))-1; end
730
+ emit :keyword end
731
+ when 13 then
732
+ begin begin @p = (( @te))-1; end
733
+ emit :identifier end
734
+ when 15 then
735
+ begin begin @p = (( @te))-1; end
736
+ emit :equal end
737
+ when 27 then
738
+ begin begin @p = (( @te))-1; end
739
+ error end
740
+ end
741
+ end
742
+ # line 743 "lib/liquidscript/scanner/lexer.rb"
743
+ end # action switch
744
+ end
745
+ end
746
+ if _trigger_goto
747
+ next
748
+ end
749
+ end
750
+ if _goto_level <= _again
751
+ _acts = _lexer_to_state_actions[ @cs]
752
+ _nacts = _lexer_actions[_acts]
753
+ _acts += 1
754
+ while _nacts > 0
755
+ _nacts -= 1
756
+ _acts += 1
757
+ case _lexer_actions[_acts - 1]
758
+ when 0 then
759
+ # line 1 "NONE"
760
+ begin
761
+ @ts = nil; end
762
+ # line 763 "lib/liquidscript/scanner/lexer.rb"
763
+ end # to state action switch
764
+ end
765
+ if _trigger_goto
766
+ next
767
+ end
768
+ @p += 1
769
+ if @p != @pe
770
+ _goto_level = _resume
771
+ next
772
+ end
773
+ end
774
+ if _goto_level <= _test_eof
775
+ if @p == @eof
776
+ if _lexer_eof_trans[ @cs] > 0
777
+ _trans = _lexer_eof_trans[ @cs] - 1;
778
+ _goto_level = _eof_trans
779
+ next;
780
+ end
781
+ end
782
+ end
783
+ if _goto_level <= _out
784
+ break
785
+ end
786
+ end
787
+ end
788
+
789
+ # line 110 "lib/liquidscript/scanner/lexer.rl"
790
+
791
+ clean!
792
+
793
+ @tokens
794
+ end
795
+ end
796
+ end
797
+ end
@@ -1,5 +1,5 @@
1
1
  module Liquidscript
2
2
 
3
3
  # The current version of liquidscript.
4
- VERSION = "0.1.0".freeze
4
+ VERSION = "0.1.1".freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquidscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Rodi
@@ -130,6 +130,7 @@ files:
130
130
  - lib/liquidscript/icr/sexp.rb
131
131
  - lib/liquidscript/icr/variable.rb
132
132
  - lib/liquidscript/scanner.rb
133
+ - lib/liquidscript/scanner/lexer.rb
133
134
  - lib/liquidscript/scanner/lexer.rl
134
135
  - lib/liquidscript/scanner/token.rb
135
136
  - lib/liquidscript/template.rb