bel_parser 1.0.0.alpha.38-java → 1.0.0.alpha.39-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/bel_parser/ast_filter.rb +6 -2
  4. data/lib/bel_parser/parsers/ast/node.rb +113 -58
  5. data/lib/bel_parser/parsers/bel_script/define_annotation.rb +4175 -3097
  6. data/lib/bel_parser/parsers/bel_script/define_annotation.rl +142 -49
  7. data/lib/bel_parser/parsers/bel_script/define_namespace.rb +980 -461
  8. data/lib/bel_parser/parsers/bel_script/define_namespace.rl +79 -39
  9. data/lib/bel_parser/parsers/bel_script/set.rb +4878 -2743
  10. data/lib/bel_parser/parsers/bel_script/set.rl +114 -32
  11. data/lib/bel_parser/parsers/bel_script/set_document.rb +5839 -5292
  12. data/lib/bel_parser/parsers/bel_script/set_document.rl +130 -27
  13. data/lib/bel_parser/parsers/bel_script/unset.rb +321 -234
  14. data/lib/bel_parser/parsers/bel_script/unset.rl +49 -21
  15. data/lib/bel_parser/parsers/common/blank_line.rb +12 -11
  16. data/lib/bel_parser/parsers/common/blank_line.rl +12 -12
  17. data/lib/bel_parser/parsers/common/comment_line.rb +65 -40
  18. data/lib/bel_parser/parsers/common/comment_line.rl +26 -26
  19. data/lib/bel_parser/parsers/common/common.rl +60 -0
  20. data/lib/bel_parser/parsers/common/function.rb +319 -0
  21. data/lib/bel_parser/parsers/common/function.rl +149 -0
  22. data/lib/bel_parser/parsers/common/identifier.rb +72 -68
  23. data/lib/bel_parser/parsers/common/identifier.rl +73 -29
  24. data/lib/bel_parser/parsers/common/list.rb +1617 -1243
  25. data/lib/bel_parser/parsers/common/list.rl +120 -60
  26. data/lib/bel_parser/parsers/common/string.rb +114 -41
  27. data/lib/bel_parser/parsers/common/string.rl +91 -28
  28. data/lib/bel_parser/parsers/common.rb +1 -0
  29. data/lib/bel_parser/parsers/expression/comment.rb +70 -38
  30. data/lib/bel_parser/parsers/expression/comment.rl +37 -20
  31. data/lib/bel_parser/parsers/expression/nested_statement.rb +63116 -13958
  32. data/lib/bel_parser/parsers/expression/nested_statement.rl +53 -23
  33. data/lib/bel_parser/parsers/expression/observed_term.rb +32497 -5188
  34. data/lib/bel_parser/parsers/expression/observed_term.rl +25 -20
  35. data/lib/bel_parser/parsers/expression/parameter.rb +2861 -847
  36. data/lib/bel_parser/parsers/expression/parameter.rl +178 -21
  37. data/lib/bel_parser/parsers/expression/relationship.rb +73 -55
  38. data/lib/bel_parser/parsers/expression/relationship.rl +41 -23
  39. data/lib/bel_parser/parsers/expression/simple_statement.rb +42895 -7846
  40. data/lib/bel_parser/parsers/expression/simple_statement.rl +41 -24
  41. data/lib/bel_parser/parsers/expression/term.rb +16498 -2602
  42. data/lib/bel_parser/parsers/expression/term.rl +52 -35
  43. data/lib/bel_parser/parsers/line_parser.rb +1 -0
  44. data/lib/bel_parser/parsers/mixin/buffer.rb +4 -0
  45. data/lib/bel_parser/parsers/tracer.rb +19 -0
  46. data/lib/bel_parser/script/state/namespace_definition.rb +1 -0
  47. metadata +10 -7
@@ -3,79 +3,134 @@
3
3
  %%{
4
4
  machine bel;
5
5
 
6
+ include 'common.rl';
6
7
  include 'identifier.rl';
7
8
  include 'string.rl';
8
9
 
9
- action clear {
10
- @buffers.delete(:string)
11
- @buffers.delete(:ident)
10
+ action start_list {
11
+ trace('LIST start_list')
12
+ @list_opened = true
13
+ @incomplete[:list] = list()
12
14
  }
13
15
 
14
- action string {
15
- @buffers[:list_arg] = list_item(@buffers[:string])
16
+ action stop_list {
17
+ trace('LIST stop_list')
18
+ @list_closed = true
16
19
  }
17
20
 
18
- action ident {
19
- @buffers[:list_arg] = list_item(@buffers[:ident])
21
+ action add_string {
22
+ trace('LIST add_string')
23
+ string = @buffers.delete(:string)
24
+ item = list_item(string, complete: string.complete)
25
+ @incomplete[:list] <<= item
20
26
  }
21
27
 
22
- action start_list {
23
- @buffers[:list] = list()
28
+ action add_ident {
29
+ trace('LIST add_ident')
30
+ ident = @buffers.delete(:ident)
31
+ item = list_item(ident, complete: ident.complete)
32
+ @incomplete[:list] <<= item
24
33
  }
25
34
 
26
- action append_list {
27
- # Append list argument if its value is not empty.
28
- if @buffers[:list_arg]
29
- list_arg_value = @buffers[:list_arg].children[0].children[0]
30
- if list_arg_value != ''
31
- @buffers[:list] <<= @buffers[:list_arg]
32
- end
35
+ action list_end {
36
+ trace('LIST list_end')
37
+ if @list_opened && @list_closed
38
+ list = @incomplete.delete(:list)
39
+ list.complete = true
40
+ elsif !@list_closed
41
+ list = @incomplete.delete(:list)
42
+ list.complete = false
33
43
  end
44
+ @buffers[:list] = list
34
45
  }
35
46
 
36
- action finish_list {
37
- #TODO: Mark @buffers[:list] as complete.
38
- }
39
-
40
- action error_list_string {
41
- #TODO: Mark @buffers[:list_arg] string as error.
42
- @buffers[:list_arg] = list_item(@buffers[:string])
47
+ action a_list_eof {
48
+ trace('LIST a_list_eof')
49
+ list = @incomplete.delete(:list)
50
+ string = @buffers.delete(:string)
51
+ unless string.nil?
52
+ item = list_item(string, complete: string.complete)
53
+ list <<= item
54
+ end
55
+ ident = @buffers.delete(:ident)
56
+ unless ident.nil?
57
+ item = list_item(ident, complete: ident.complete)
58
+ list <<= item
59
+ end
60
+ if @list_opened && @list_closed
61
+ list.complete = true
62
+ else
63
+ list.complete = false
64
+ end
65
+ @buffers[:list] = list
43
66
  }
44
67
 
45
- action error_list_ident {
46
- #TODO: Mark @buffers[:list_arg] identifier as error.
47
- @buffers[:list_arg] = list_item(@buffers[:ident])
68
+ action list_node_eof {
69
+ trace('LIST list_node_eof')
70
+ list = @incomplete.delete(:list)
71
+ string = @buffers.delete(:string)
72
+ item = list_item(string, complete: string.complete)
73
+ list <<= item
74
+ list.complete = false
75
+ yield list
48
76
  }
49
77
 
50
- action yield_complete_list {
78
+ action yield_list {
79
+ trace('LIST yield_list')
51
80
  yield @buffers[:list]
52
81
  }
53
82
 
54
- action yield_error_list {
55
- @buffers[:list] ||= list()
56
- yield @buffers[:list]
57
- }
83
+ START_LIST = '{' SP* >start_list;
84
+ END_LIST = '}' %stop_list;
58
85
 
59
- LIST =
60
- '{' @start_list
61
- SP*
62
- (
63
- STRING %string $err(error_list_string) |
64
- IDENT %ident $err(error_list_ident)
65
- )? $err(append_list) %append_list
86
+ string_item =
87
+ a_string
88
+ %add_string
89
+ ;
90
+
91
+ ident_item =
92
+ an_ident
93
+ %add_ident
94
+ ;
95
+
96
+ item =
97
+ string_item |
98
+ ident_item
99
+ ;
100
+
101
+ list_item_0 =
102
+ item
103
+ ;
104
+
105
+ list_item_n =
106
+ COMMA_DELIM
107
+ item
108
+ ;
109
+
110
+ items =
111
+ list_item_0
112
+ list_item_n*
66
113
  SP*
67
- (
68
- ',' @clear
69
- SP*
70
- (
71
- STRING %string $err(error_list_string) |
72
- IDENT %ident $err(error_list_ident)
73
- ) $err(append_list) %append_list
74
- SP*
75
- )*
76
- '}' @finish_list;
77
-
78
- list := LIST $err(yield_error_list) %yield_complete_list NL;
114
+ ;
115
+
116
+ a_list =
117
+ START_LIST
118
+ items
119
+ END_LIST
120
+ %list_end
121
+ @eof(a_list_eof)
122
+ ;
123
+
124
+ list_node :=
125
+ START_LIST
126
+ items?
127
+ @eof(list_node_eof)
128
+ END_LIST?
129
+ @eof(list_node_eof)
130
+ NL?
131
+ %list_end
132
+ %yield_list
133
+ ;
79
134
  }%%
80
135
  =end
81
136
  # end: ragel
@@ -83,6 +138,7 @@
83
138
  require_relative '../ast/node'
84
139
  require_relative '../mixin/buffer'
85
140
  require_relative '../nonblocking_io_wrapper'
141
+ require_relative '../tracer'
86
142
 
87
143
  module BELParser
88
144
  module Parsers
@@ -108,25 +164,29 @@ module BELParser
108
164
  include Enumerable
109
165
  include BELParser::Parsers::Buffer
110
166
  include BELParser::Parsers::AST::Sexp
167
+ include BELParser::Parsers::Tracer
111
168
 
112
169
  def initialize(content)
113
170
  @content = content
114
- # begin: ragel
171
+ # begin: ragel
115
172
  %% write data;
116
- # end: ragel
173
+ # end: ragel
117
174
  end
118
175
 
119
176
  def each
120
- @buffers = {}
121
- data = @content.unpack('C*')
122
- p = 0
123
- pe = data.length
124
- eof = data.length
125
-
126
- # begin: ragel
177
+ @buffers = {}
178
+ @incomplete = {}
179
+ @list_opened = false
180
+ @list_closed = false
181
+ data = @content.unpack('C*')
182
+ p = 0
183
+ pe = data.length
184
+ eof = data.length
185
+
186
+ # begin: ragel
127
187
  %% write init;
128
188
  %% write exec;
129
- # end: ragel
189
+ # end: ragel
130
190
  end
131
191
  end
132
192
  end
@@ -5,10 +5,12 @@
5
5
 
6
6
  =end
7
7
  # end: ragel
8
+ # ('\"' | ^(0 .. 31 | 34))* ^'\\"'
8
9
 
9
10
  require_relative '../ast/node'
10
11
  require_relative '../mixin/buffer'
11
12
  require_relative '../nonblocking_io_wrapper'
13
+ require_relative '../tracer'
12
14
 
13
15
  module BELParser
14
16
  module Parsers
@@ -34,18 +36,19 @@ module BELParser
34
36
  include Enumerable
35
37
  include BELParser::Parsers::Buffer
36
38
  include BELParser::Parsers::AST::Sexp
39
+ include BELParser::Parsers::Tracer
37
40
 
38
41
  def initialize(content)
39
42
  @content = content
40
- # begin: ragel
43
+ # begin: ragel
41
44
 
42
45
  class << self
43
46
  attr_accessor :_bel_trans_keys
44
47
  private :_bel_trans_keys, :_bel_trans_keys=
45
48
  end
46
49
  self._bel_trans_keys = [
47
- 0, 0, 34, 34, 34, 92,
48
- 10, 10, 92, 92, 0,
50
+ 0, 0, 9, 34, 34, 92,
51
+ 34, 92, 0, 0, 0,
49
52
  0, 0
50
53
  ]
51
54
 
@@ -54,7 +57,7 @@ class << self
54
57
  private :_bel_key_spans, :_bel_key_spans=
55
58
  end
56
59
  self._bel_key_spans = [
57
- 0, 1, 59, 1, 1, 0
60
+ 0, 26, 59, 59, 0, 0
58
61
  ]
59
62
 
60
63
  class << self
@@ -62,7 +65,7 @@ class << self
62
65
  private :_bel_index_offsets, :_bel_index_offsets=
63
66
  end
64
67
  self._bel_index_offsets = [
65
- 0, 0, 2, 62, 64, 66
68
+ 0, 0, 27, 87, 147, 148
66
69
  ]
67
70
 
68
71
  class << self
@@ -70,15 +73,25 @@ class << self
70
73
  private :_bel_indicies, :_bel_indicies=
71
74
  end
72
75
  self._bel_indicies = [
73
- 1, 0, 3, 2, 2, 2, 2, 2,
74
- 2, 2, 2, 2, 2, 2, 2, 2,
75
- 2, 2, 2, 2, 2, 2, 2, 2,
76
- 2, 2, 2, 2, 2, 2, 2, 2,
77
- 2, 2, 2, 2, 2, 2, 2, 2,
78
- 2, 2, 2, 2, 2, 2, 2, 2,
79
- 2, 2, 2, 2, 2, 2, 2, 2,
80
- 2, 2, 2, 2, 4, 2, 5, 0,
81
- 4, 2, 6, 0
76
+ 1, 1, 1, 1, 1, 0, 0, 0,
77
+ 0, 0, 0, 0, 0, 0, 0, 0,
78
+ 0, 0, 0, 0, 0, 0, 0, 1,
79
+ 0, 2, 0, 4, 3, 3, 3, 3,
80
+ 3, 3, 3, 3, 3, 3, 3, 3,
81
+ 3, 3, 3, 3, 3, 3, 3, 3,
82
+ 3, 3, 3, 3, 3, 3, 3, 3,
83
+ 3, 3, 3, 3, 3, 3, 3, 3,
84
+ 3, 3, 3, 3, 3, 3, 3, 3,
85
+ 3, 3, 3, 3, 3, 3, 3, 3,
86
+ 3, 3, 3, 3, 3, 5, 3, 7,
87
+ 6, 6, 6, 6, 6, 6, 6, 6,
88
+ 6, 6, 6, 6, 6, 6, 6, 6,
89
+ 6, 6, 6, 6, 6, 6, 6, 6,
90
+ 6, 6, 6, 6, 6, 6, 6, 6,
91
+ 6, 6, 6, 6, 6, 6, 6, 6,
92
+ 6, 6, 6, 6, 6, 6, 6, 6,
93
+ 6, 6, 6, 6, 6, 6, 6, 6,
94
+ 6, 8, 6, 6, 0, 0
82
95
  ]
83
96
 
84
97
  class << self
@@ -86,7 +99,8 @@ class << self
86
99
  private :_bel_trans_targs, :_bel_trans_targs=
87
100
  end
88
101
  self._bel_trans_targs = [
89
- 0, 2, 2, 3, 4, 5, 0
102
+ 0, 1, 2, 3, 5, 4, 3, 5,
103
+ 4
90
104
  ]
91
105
 
92
106
  class << self
@@ -94,7 +108,8 @@ class << self
94
108
  private :_bel_trans_actions, :_bel_trans_actions=
95
109
  end
96
110
  self._bel_trans_actions = [
97
- 1, 2, 3, 3, 3, 4, 0
111
+ 2, 0, 0, 4, 5, 4, 0, 6,
112
+ 0
98
113
  ]
99
114
 
100
115
  class << self
@@ -102,7 +117,7 @@ class << self
102
117
  private :_bel_eof_actions, :_bel_eof_actions=
103
118
  end
104
119
  self._bel_eof_actions = [
105
- 0, 1, 1, 1, 1, 0
120
+ 0, 1, 3, 3, 3, 0
106
121
  ]
107
122
 
108
123
  class << self
@@ -119,22 +134,27 @@ end
119
134
  self.bel_error = 0;
120
135
 
121
136
  class << self
122
- attr_accessor :bel_en_string
137
+ attr_accessor :bel_en_string_node
123
138
  end
124
- self.bel_en_string = 1;
139
+ self.bel_en_string_node = 1;
125
140
 
126
141
 
127
- # end: ragel
142
+ # end: ragel
128
143
  end
129
144
 
130
145
  def each
131
- @buffers = {}
132
- data = @content.unpack('C*')
133
- p = 0
134
- pe = data.length
135
- eof = data.length
136
-
137
- # begin: ragel
146
+ @buffers = {}
147
+ @incomplete = {}
148
+ @string_opened = false
149
+ @string_closed = false
150
+ data = @content.unpack('C*')
151
+ p_start = 0
152
+ p_end = 0
153
+ p = 0
154
+ pe = data.length
155
+ eof = data.length
156
+
157
+ # begin: ragel
138
158
 
139
159
  begin
140
160
  p ||= 0
@@ -179,38 +199,66 @@ begin
179
199
  cs = _bel_trans_targs[_trans]
180
200
  if _bel_trans_actions[_trans] != 0
181
201
  case _bel_trans_actions[_trans]
182
- when 3 then
202
+ when 4 then
183
203
  begin
184
204
 
185
- (@buffers[:string] ||= []) << data[p].ord
205
+ trace('STRING start_string')
206
+ @string_opened = true
207
+ p_start = p
186
208
  end
187
209
  when 2 then
188
210
  begin
189
211
 
190
- @buffers[:string] = []
212
+ trace('STRING string_node_err')
213
+ p_end = p
214
+ chars = data[p_start...p_end]
215
+ ast_node = string(utf8_string(chars), complete: false)
216
+ yield ast_node
191
217
  end
218
+ when 6 then
192
219
  begin
193
220
 
194
- (@buffers[:string] ||= []) << data[p].ord
221
+ trace('STRING stop_string')
222
+ @string_closed = true
223
+ p_end = p
195
224
  end
196
- when 4 then
197
225
  begin
198
226
 
199
- @buffers[:string] = string(utf8_string(@buffers[:string]))
227
+ trace('STRING string_end')
228
+ completed = @string_opened && @string_closed
229
+ chars = data[p_start...p_end]
230
+ ast_node = string(utf8_string(chars), complete: true)
231
+ @buffers[:string] = ast_node
200
232
  end
201
233
  begin
202
234
 
235
+ trace('STRING yield_string')
203
236
  yield @buffers[:string]
204
237
  end
205
- when 1 then
238
+ when 5 then
239
+ begin
240
+
241
+ trace('STRING start_string')
242
+ @string_opened = true
243
+ p_start = p
244
+ end
245
+ begin
246
+
247
+ trace('STRING stop_string')
248
+ @string_closed = true
249
+ p_end = p
250
+ end
206
251
  begin
207
252
 
208
- @buffers[:string] ||= []
209
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
253
+ trace('STRING string_end')
254
+ completed = @string_opened && @string_closed
255
+ chars = data[p_start...p_end]
256
+ ast_node = string(utf8_string(chars), complete: true)
257
+ @buffers[:string] = ast_node
210
258
  end
211
259
  begin
212
260
 
213
- @buffers[:string] ||= []
261
+ trace('STRING yield_string')
214
262
  yield @buffers[:string]
215
263
  end
216
264
  end
@@ -233,12 +281,37 @@ begin
233
281
  when 1 then
234
282
  begin
235
283
 
236
- @buffers[:string] ||= []
237
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
284
+ trace('STRING string_node_err')
285
+ p_end = p
286
+ chars = data[p_start...p_end]
287
+ ast_node = string(utf8_string(chars), complete: false)
288
+ yield ast_node
289
+ end
290
+ begin
291
+
292
+ trace('STRING string_node_eof')
293
+ yield @buffers[:string]
294
+ end
295
+ when 3 then
296
+ begin
297
+
298
+ trace('STRING eof_string')
299
+ p_end = p
300
+ chars = data[p_start...p_end]
301
+ ast_node = string(utf8_string(chars), complete: false)
302
+ @buffers[:string] = ast_node
303
+ end
304
+ begin
305
+
306
+ trace('STRING string_node_err')
307
+ p_end = p
308
+ chars = data[p_start...p_end]
309
+ ast_node = string(utf8_string(chars), complete: false)
310
+ yield ast_node
238
311
  end
239
312
  begin
240
313
 
241
- @buffers[:string] ||= []
314
+ trace('STRING string_node_eof')
242
315
  yield @buffers[:string]
243
316
  end
244
317
  end
@@ -251,7 +324,7 @@ begin
251
324
  end
252
325
  end
253
326
 
254
- # end: ragel
327
+ # end: ragel
255
328
  end
256
329
  end
257
330
  end
@@ -5,45 +5,102 @@
5
5
 
6
6
  include 'common.rl';
7
7
 
8
- action start_string {
9
- @buffers[:string] = []
8
+ action string_end {
9
+ trace('STRING string_end')
10
+ completed = @string_opened && @string_closed
11
+ chars = data[p_start...p_end]
12
+ ast_node = string(utf8_string(chars), complete: true)
13
+ @buffers[:string] = ast_node
10
14
  }
11
15
 
12
- action append_string {
13
- (@buffers[:string] ||= []) << fc
16
+ action yield_string {
17
+ trace('STRING yield_string')
18
+ yield @buffers[:string]
14
19
  }
15
20
 
16
- action finish_string {
17
- @buffers[:string] = string(utf8_string(@buffers[:string]))
21
+ action start_string {
22
+ trace('STRING start_string')
23
+ @string_opened = true
24
+ p_start = p
18
25
  }
19
26
 
20
- action error_string {
21
- @buffers[:string] ||= []
22
- @buffers[:string] = string(utf8_string(@buffers[:string]).sub(/\n$/, ''))
27
+ action stop_string {
28
+ trace('STRING stop_string')
29
+ @string_closed = true
30
+ p_end = p
23
31
  }
24
32
 
25
- action yield_complete_string {
26
- yield @buffers[:string]
33
+ action eof_string {
34
+ trace('STRING eof_string')
35
+ p_end = p
36
+ chars = data[p_start...p_end]
37
+ ast_node = string(utf8_string(chars), complete: false)
38
+ @buffers[:string] = ast_node
27
39
  }
28
40
 
29
- action yield_error_string {
30
- @buffers[:string] ||= []
41
+ action string_node_eof {
42
+ trace('STRING string_node_eof')
31
43
  yield @buffers[:string]
32
44
  }
33
45
 
34
- STRING =
35
- ('"' ('\\\"' | [^"])** '"') >start_string $append_string %finish_string $err(error_string);
46
+ action a_string_err {
47
+ trace('STRING a_string_err')
48
+ p_end = p
49
+ chars = data[p_start...p_end]
50
+ ast_node = string(utf8_string(chars), complete: false)
51
+ @buffers[:string] = ast_node
52
+ }
53
+
54
+ action string_node_err {
55
+ trace('STRING string_node_err')
56
+ p_end = p
57
+ chars = data[p_start...p_end]
58
+ ast_node = string(utf8_string(chars), complete: false)
59
+ yield ast_node
60
+ }
36
61
 
37
- string :=
38
- STRING $err(yield_error_string) %yield_complete_string
39
- NL;
62
+ #single =
63
+ # WS* SQ (NOT_SQESC | ESCAPED)*
64
+ # >start_string
65
+ # $eof(eof_string)
66
+ # %stop_string
67
+ # %string_end
68
+ # SQ
69
+ # ;
70
+
71
+ double =
72
+ WS* DQ (NOT_DQESC | ESCAPED)*
73
+ >start_string
74
+ $eof(eof_string)
75
+ %stop_string
76
+ %string_end
77
+ DQ
78
+ ;
79
+
80
+ a_string =
81
+ #(single | double)
82
+ double
83
+ $err(a_string_err)
84
+ ;
85
+
86
+ string_node :=
87
+ (
88
+ #single |
89
+ double
90
+ )
91
+ $err(string_node_err)
92
+ @eof(string_node_eof)
93
+ @yield_string
94
+ ;
40
95
  }%%
41
96
  =end
42
97
  # end: ragel
98
+ # ('\"' | ^(0 .. 31 | 34))* ^'\\"'
43
99
 
44
100
  require_relative '../ast/node'
45
101
  require_relative '../mixin/buffer'
46
102
  require_relative '../nonblocking_io_wrapper'
103
+ require_relative '../tracer'
47
104
 
48
105
  module BELParser
49
106
  module Parsers
@@ -69,25 +126,31 @@ module BELParser
69
126
  include Enumerable
70
127
  include BELParser::Parsers::Buffer
71
128
  include BELParser::Parsers::AST::Sexp
129
+ include BELParser::Parsers::Tracer
72
130
 
73
131
  def initialize(content)
74
132
  @content = content
75
- # begin: ragel
133
+ # begin: ragel
76
134
  %% write data;
77
- # end: ragel
135
+ # end: ragel
78
136
  end
79
137
 
80
138
  def each
81
- @buffers = {}
82
- data = @content.unpack('C*')
83
- p = 0
84
- pe = data.length
85
- eof = data.length
86
-
87
- # begin: ragel
139
+ @buffers = {}
140
+ @incomplete = {}
141
+ @string_opened = false
142
+ @string_closed = false
143
+ data = @content.unpack('C*')
144
+ p_start = 0
145
+ p_end = 0
146
+ p = 0
147
+ pe = data.length
148
+ eof = data.length
149
+
150
+ # begin: ragel
88
151
  %% write init;
89
152
  %% write exec;
90
- # end: ragel
153
+ # end: ragel
91
154
  end
92
155
  end
93
156
  end
@@ -3,3 +3,4 @@ require_relative 'common/comment_line'
3
3
  require_relative 'common/identifier'
4
4
  require_relative 'common/string'
5
5
  require_relative 'common/list'
6
+ require_relative 'common/function'