vorax 0.3.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vorax/parser/grammars/common.rl +6 -0
- data/lib/vorax/parser/grammars/declare.rb +9087 -681
- data/lib/vorax/parser/grammars/declare.rl +106 -24
- data/lib/vorax/parser/grammars/for_block.rb +134 -107
- data/lib/vorax/parser/grammars/for_block.rl +9 -3
- data/lib/vorax/parser/plsql_structure.rb +1 -1
- data/lib/vorax/version.rb +1 -1
- data/spec/declare_spec.rb +261 -28
- data/spec/parser_spec.rb +4 -0
- data/spec/sql/muci.spc +2 -0
- metadata +2 -4
- data/spec/sql/dbms_crypto.~spc +0 -339
@@ -12,29 +12,68 @@ action end_identifier {
|
|
12
12
|
@end = p - 1
|
13
13
|
}
|
14
14
|
|
15
|
-
|
15
|
+
action tail {
|
16
|
+
p = p - 1
|
17
|
+
te = p
|
18
|
+
}
|
19
|
+
|
20
|
+
prev_terminator = (';' ws*) | (ws+ (K_AS | K_IS | K_DECLARE) ws+);
|
21
|
+
next_terminator = ';' | (ws+ (K_AS | K_IS) ws+);
|
16
22
|
id = identifier >start_identifier %end_identifier;
|
17
23
|
variable_name = id - (K_CURSOR | K_TYPE | K_FUNCTION | K_PROCEDURE | K_END | K_PRAGMA);
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
variable_type = qualified_identifier (K_ROWTYPE | K_VARTYPE)?;
|
25
|
+
|
26
|
+
constant = prev_terminator
|
27
|
+
(id ws+ K_CONSTANT ws+
|
28
|
+
(qualified_identifier >{@start_qi = p} %{@end_qi = p - 1})
|
29
|
+
(( any )* :>> ';') %tail
|
30
|
+
) >{@start_capture = p};
|
31
|
+
|
32
|
+
exception = prev_terminator
|
33
|
+
(variable_name ws+ K_EXCEPTION
|
34
|
+
(( any )* :>> ';') %tail
|
35
|
+
) >{@start_capture = p};
|
36
|
+
|
37
|
+
cursor = prev_terminator
|
38
|
+
(K_CURSOR ws+ id ws+ K_IS ws+
|
39
|
+
(( any )* :>> ';') %tail
|
40
|
+
) >{@start_capture = p};
|
41
|
+
|
42
|
+
type = prev_terminator
|
43
|
+
(K_TYPE ws+ id ws+ K_IS ws+
|
44
|
+
(qualified_identifier >{@start_qi = p} %{@end_qi = p - 1})
|
45
|
+
(( any )* :>> ';') %tail
|
46
|
+
) >{@start_capture = p};
|
47
|
+
|
48
|
+
var = prev_terminator
|
49
|
+
(
|
50
|
+
variable_name ws+ (variable_type >{@start_qi = p} %{@end_qi = p - 1})
|
51
|
+
(( any )* :>> ';') %tail
|
52
|
+
) >{@start_capture = p};
|
53
|
+
|
54
|
+
function = prev_terminator
|
55
|
+
(
|
56
|
+
K_FUNCTION ws+ id
|
57
|
+
(( any )* :>> next_terminator) %tail
|
58
|
+
) >{@start_capture = p};
|
59
|
+
|
60
|
+
procedure = prev_terminator
|
61
|
+
(
|
62
|
+
K_PROCEDURE ws+ id
|
63
|
+
(( any )* :>> next_terminator) %tail
|
64
|
+
) >{@start_capture = p};
|
26
65
|
|
27
66
|
main := |*
|
28
67
|
squoted_string;
|
29
68
|
dquoted_string;
|
30
69
|
comment;
|
31
|
-
constant => {
|
32
|
-
exception => {
|
33
|
-
cursor => {
|
34
|
-
type => {
|
35
|
-
|
36
|
-
function => {
|
37
|
-
procedure => {
|
70
|
+
constant => { add_item(:constant, te) };
|
71
|
+
exception => { add_item(:exception, te) };
|
72
|
+
cursor => { add_item(:cursor, te) };
|
73
|
+
type => { add_item(:type, te) };
|
74
|
+
var => { add_item(:variable, te) };
|
75
|
+
function => { add_item(:function, te) };
|
76
|
+
procedure => { add_item(:procedure, te) };
|
38
77
|
any => {};
|
39
78
|
*|;
|
40
79
|
|
@@ -46,22 +85,50 @@ module Vorax
|
|
46
85
|
|
47
86
|
module Parser
|
48
87
|
|
88
|
+
class DeclareItem
|
89
|
+
|
90
|
+
attr_reader :name
|
91
|
+
attr_accessor :is_a, :captured_text, :type
|
92
|
+
|
93
|
+
def initialize(name, is_a = nil, type = nil, captured_text = '')
|
94
|
+
@name = name
|
95
|
+
@is_a = is_a
|
96
|
+
@type = type
|
97
|
+
@captured_text = captured_text
|
98
|
+
end
|
99
|
+
|
100
|
+
def ==(obj)
|
101
|
+
self.name == obj.name && self.is_a == obj.is_a && self.type == obj.type && self.captured_text == obj.captured_text
|
102
|
+
end
|
103
|
+
|
104
|
+
def debug_constructor
|
105
|
+
"DeclareItem.new(#{@name.inspect}, #{@is_a.inspect}, #{@type.inspect}, #{@captured_text.inspect})"
|
106
|
+
end
|
107
|
+
|
108
|
+
def to_vim
|
109
|
+
"{'name' : #{@name.to_s.inspect}," +
|
110
|
+
" 'is_a' : #{@is_a.to_s.inspect}," +
|
111
|
+
" 'type' : #{@type.to_s.inspect}," +
|
112
|
+
" 'captured_text' : #{@captured_text.to_s.inspect}}"
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
116
|
+
|
49
117
|
# A class used to parse a PLSQL package spec.
|
50
118
|
class Declare
|
51
119
|
|
52
|
-
attr_reader :
|
120
|
+
attr_reader :items
|
121
|
+
|
122
|
+
def initialize(declare_code)
|
123
|
+
@code = Parser.remove_all_comments(declare_code)
|
124
|
+
walk(@code)
|
125
|
+
end
|
53
126
|
|
54
127
|
# Walks the provided spec in order to compute the structure.
|
55
128
|
#
|
56
129
|
# param data [String] the package spec
|
57
130
|
def walk(data)
|
58
|
-
@
|
59
|
-
@types = Set.new
|
60
|
-
@exceptions = Set.new
|
61
|
-
@cursors = Set.new
|
62
|
-
@variables = Set.new
|
63
|
-
@functions = Set.new
|
64
|
-
@procedures = Set.new
|
131
|
+
@items = []
|
65
132
|
if data
|
66
133
|
eof = data.length
|
67
134
|
%% write data;
|
@@ -70,6 +137,21 @@ module Vorax
|
|
70
137
|
end
|
71
138
|
end
|
72
139
|
|
140
|
+
def to_vim
|
141
|
+
"[ #{@items.map { |i| i.to_vim }.join(',')} ]"
|
142
|
+
end
|
143
|
+
|
144
|
+
private
|
145
|
+
|
146
|
+
def add_item(type, te)
|
147
|
+
item = DeclareItem.new(@code[(@start..@end)])
|
148
|
+
item.is_a = type
|
149
|
+
item.type = @code[(@start_qi..@end_qi)] if @start_qi && @end_qi
|
150
|
+
item.captured_text = @code[(@start_capture..te)]
|
151
|
+
@items << item
|
152
|
+
@start_qi = @end_qi = nil
|
153
|
+
end
|
154
|
+
|
73
155
|
end
|
74
156
|
|
75
157
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
# line 1 "lib/vorax/parser/grammars/for_block.rl"
|
3
3
|
|
4
|
-
# line
|
4
|
+
# line 47 "lib/vorax/parser/grammars/for_block.rl"
|
5
5
|
|
6
6
|
|
7
7
|
|
@@ -23,8 +23,8 @@ class << self
|
|
23
23
|
private :_for_block_actions, :_for_block_actions=
|
24
24
|
end
|
25
25
|
self._for_block_actions = [
|
26
|
-
0, 1, 0, 1, 1, 1,
|
27
|
-
|
26
|
+
0, 1, 0, 1, 1, 1, 3, 1,
|
27
|
+
4, 1, 5, 2, 6, 2
|
28
28
|
]
|
29
29
|
|
30
30
|
class << self
|
@@ -34,14 +34,15 @@ end
|
|
34
34
|
self._for_block_key_offsets = [
|
35
35
|
0, 0, 2, 4, 6, 11, 24, 25,
|
36
36
|
30, 37, 38, 39, 40, 41, 43, 45,
|
37
|
-
51, 69, 70,
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
37
|
+
51, 69, 70, 76, 83, 84, 85, 86,
|
38
|
+
87, 89, 91, 93, 95, 100, 101, 102,
|
39
|
+
103, 104, 106, 114, 115, 121, 129, 130,
|
40
|
+
135, 149, 164, 179, 180, 181, 182, 183,
|
41
|
+
185, 193, 199, 200, 201, 202, 209, 210,
|
42
|
+
211, 212, 213, 215, 222, 223, 224, 226,
|
43
|
+
243, 260, 277, 294, 311, 328, 343, 350,
|
44
|
+
351, 352, 353, 354, 356, 370, 371, 372,
|
45
|
+
373, 374, 376
|
45
46
|
]
|
46
47
|
|
47
48
|
class << self
|
@@ -58,37 +59,45 @@ self._for_block_trans_keys = [
|
|
58
59
|
47, 9, 13, 32, 34, 40, 45, 47,
|
59
60
|
82, 95, 114, 9, 13, 35, 36, 48,
|
60
61
|
57, 65, 90, 97, 122, 34, 32, 45,
|
61
|
-
47, 9, 13, 32, 45, 47, 76,
|
62
|
-
9, 13, 45, 10, 42, 42, 42,
|
63
|
-
79, 111, 79, 111, 80, 112, 32,
|
64
|
-
47, 9, 13, 45, 10, 42, 42,
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
47,
|
76
|
-
|
77
|
-
|
78
|
-
|
62
|
+
46, 47, 9, 13, 32, 45, 47, 76,
|
63
|
+
108, 9, 13, 45, 10, 42, 42, 42,
|
64
|
+
47, 79, 111, 79, 111, 80, 112, 32,
|
65
|
+
45, 47, 9, 13, 45, 10, 42, 42,
|
66
|
+
42, 47, 34, 95, 35, 36, 65, 90,
|
67
|
+
97, 122, 34, 32, 45, 46, 47, 9,
|
68
|
+
13, 34, 95, 35, 36, 65, 90, 97,
|
69
|
+
122, 34, 32, 45, 47, 9, 13, 32,
|
70
|
+
45, 47, 95, 9, 13, 35, 36, 48,
|
71
|
+
57, 65, 90, 97, 122, 32, 45, 46,
|
72
|
+
47, 95, 9, 13, 35, 36, 48, 57,
|
73
|
+
65, 90, 97, 122, 32, 45, 46, 47,
|
74
|
+
95, 9, 13, 35, 36, 48, 57, 65,
|
75
|
+
90, 97, 122, 45, 10, 42, 42, 42,
|
76
|
+
47, 32, 45, 46, 47, 9, 13, 48,
|
77
|
+
57, 32, 45, 46, 47, 9, 13, 45,
|
78
|
+
10, 46, 32, 45, 47, 9, 13, 48,
|
79
|
+
57, 45, 10, 42, 42, 42, 47, 32,
|
80
|
+
45, 47, 9, 13, 48, 57, 42, 42,
|
81
|
+
42, 47, 32, 45, 46, 47, 69, 95,
|
82
|
+
101, 9, 13, 35, 36, 48, 57, 65,
|
83
|
+
90, 97, 122, 32, 45, 46, 47, 86,
|
84
|
+
95, 118, 9, 13, 35, 36, 48, 57,
|
85
|
+
65, 90, 97, 122, 32, 45, 46, 47,
|
86
|
+
69, 95, 101, 9, 13, 35, 36, 48,
|
87
|
+
57, 65, 90, 97, 122, 32, 45, 46,
|
79
88
|
47, 82, 95, 114, 9, 13, 35, 36,
|
80
89
|
48, 57, 65, 90, 97, 122, 32, 45,
|
81
|
-
47, 83, 95, 115, 9, 13, 35,
|
82
|
-
48, 57, 65, 90, 97, 122, 32,
|
83
|
-
47, 69, 95, 101, 9, 13,
|
84
|
-
48, 57, 65, 90, 97, 122,
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
9, 13, 0
|
90
|
+
46, 47, 83, 95, 115, 9, 13, 35,
|
91
|
+
36, 48, 57, 65, 90, 97, 122, 32,
|
92
|
+
45, 46, 47, 69, 95, 101, 9, 13,
|
93
|
+
35, 36, 48, 57, 65, 90, 97, 122,
|
94
|
+
32, 45, 46, 47, 95, 9, 13, 35,
|
95
|
+
36, 48, 57, 65, 90, 97, 122, 32,
|
96
|
+
45, 47, 9, 13, 48, 57, 45, 10,
|
97
|
+
42, 42, 42, 47, 32, 45, 47, 95,
|
98
|
+
9, 13, 35, 36, 48, 57, 65, 90,
|
99
|
+
97, 122, 45, 10, 42, 42, 42, 47,
|
100
|
+
32, 45, 47, 9, 13, 0
|
92
101
|
]
|
93
102
|
|
94
103
|
class << self
|
@@ -98,12 +107,13 @@ end
|
|
98
107
|
self._for_block_single_lengths = [
|
99
108
|
0, 2, 2, 2, 3, 5, 1, 3,
|
100
109
|
5, 1, 1, 1, 1, 2, 2, 4,
|
101
|
-
8, 1,
|
110
|
+
8, 1, 4, 5, 1, 1, 1, 1,
|
102
111
|
2, 2, 2, 2, 3, 1, 1, 1,
|
103
|
-
1, 2,
|
112
|
+
1, 2, 2, 1, 4, 2, 1, 3,
|
113
|
+
4, 5, 5, 1, 1, 1, 1, 2,
|
104
114
|
4, 4, 1, 1, 1, 3, 1, 1,
|
105
|
-
1, 1, 2, 3, 1, 1, 2,
|
106
|
-
|
115
|
+
1, 1, 2, 3, 1, 1, 2, 7,
|
116
|
+
7, 7, 7, 7, 7, 5, 3, 1,
|
107
117
|
1, 1, 1, 2, 4, 1, 1, 1,
|
108
118
|
1, 2, 3
|
109
119
|
]
|
@@ -117,7 +127,8 @@ self._for_block_range_lengths = [
|
|
117
127
|
1, 0, 0, 0, 0, 0, 0, 1,
|
118
128
|
5, 0, 1, 1, 0, 0, 0, 0,
|
119
129
|
0, 0, 0, 0, 1, 0, 0, 0,
|
120
|
-
0, 0,
|
130
|
+
0, 0, 3, 0, 1, 3, 0, 1,
|
131
|
+
5, 5, 5, 0, 0, 0, 0, 0,
|
121
132
|
2, 1, 0, 0, 0, 2, 0, 0,
|
122
133
|
0, 0, 0, 2, 0, 0, 0, 5,
|
123
134
|
5, 5, 5, 5, 5, 5, 2, 0,
|
@@ -132,14 +143,15 @@ end
|
|
132
143
|
self._for_block_index_offsets = [
|
133
144
|
0, 0, 3, 6, 9, 14, 24, 26,
|
134
145
|
31, 38, 40, 42, 44, 46, 49, 52,
|
135
|
-
58, 72, 74,
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
146
|
+
58, 72, 74, 80, 87, 89, 91, 93,
|
147
|
+
95, 98, 101, 104, 107, 112, 114, 116,
|
148
|
+
118, 120, 123, 129, 131, 137, 143, 145,
|
149
|
+
150, 160, 171, 182, 184, 186, 188, 190,
|
150
|
+
193, 200, 206, 208, 210, 212, 218, 220,
|
151
|
+
222, 224, 226, 229, 235, 237, 239, 242,
|
152
|
+
255, 268, 281, 294, 307, 320, 331, 337,
|
153
|
+
339, 341, 343, 345, 348, 358, 360, 362,
|
154
|
+
364, 366, 369
|
143
155
|
]
|
144
156
|
|
145
157
|
class << self
|
@@ -156,37 +168,44 @@ self._for_block_indicies = [
|
|
156
168
|
19, 21, 21, 1, 22, 23, 24, 25,
|
157
169
|
22, 1, 22, 26, 23, 24, 25, 29,
|
158
170
|
27, 29, 22, 27, 28, 27, 27, 1,
|
159
|
-
31, 30, 32, 33, 34, 32, 1,
|
160
|
-
36, 37, 38,
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
56,
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
171
|
+
31, 30, 32, 33, 34, 35, 32, 1,
|
172
|
+
36, 37, 38, 39, 39, 36, 1, 40,
|
173
|
+
1, 36, 40, 41, 1, 42, 41, 42,
|
174
|
+
36, 41, 43, 43, 1, 44, 44, 1,
|
175
|
+
45, 45, 1, 46, 47, 48, 46, 1,
|
176
|
+
49, 1, 46, 49, 50, 1, 51, 50,
|
177
|
+
51, 46, 50, 52, 53, 53, 53, 53,
|
178
|
+
1, 54, 52, 32, 33, 55, 35, 32,
|
179
|
+
1, 56, 57, 57, 57, 57, 1, 58,
|
180
|
+
56, 32, 33, 35, 32, 1, 32, 33,
|
181
|
+
35, 57, 32, 57, 57, 57, 57, 1,
|
182
|
+
32, 33, 55, 35, 53, 32, 53, 53,
|
183
|
+
53, 53, 1, 32, 33, 34, 35, 59,
|
184
|
+
32, 59, 59, 59, 59, 1, 60, 1,
|
185
|
+
22, 60, 61, 1, 62, 61, 62, 22,
|
186
|
+
61, 63, 64, 65, 66, 63, 28, 1,
|
187
|
+
63, 64, 65, 66, 63, 1, 67, 1,
|
188
|
+
63, 67, 68, 1, 68, 69, 70, 68,
|
189
|
+
71, 1, 72, 1, 68, 72, 73, 1,
|
190
|
+
74, 73, 74, 68, 73, 36, 37, 38,
|
191
|
+
36, 71, 1, 75, 1, 76, 75, 76,
|
192
|
+
63, 75, 32, 33, 34, 35, 77, 59,
|
193
|
+
77, 32, 59, 59, 59, 59, 1, 32,
|
194
|
+
33, 34, 35, 78, 59, 78, 32, 59,
|
195
|
+
59, 59, 59, 1, 32, 33, 34, 35,
|
196
|
+
79, 59, 79, 32, 59, 59, 59, 59,
|
197
|
+
1, 32, 33, 34, 35, 80, 59, 80,
|
198
|
+
32, 59, 59, 59, 59, 1, 32, 33,
|
199
|
+
34, 35, 81, 59, 81, 32, 59, 59,
|
200
|
+
59, 59, 1, 32, 33, 34, 35, 82,
|
201
|
+
59, 82, 32, 59, 59, 59, 59, 1,
|
202
|
+
83, 84, 34, 85, 59, 83, 59, 59,
|
203
|
+
59, 59, 1, 83, 84, 85, 83, 28,
|
204
|
+
1, 86, 1, 83, 86, 87, 1, 88,
|
205
|
+
87, 88, 83, 87, 11, 12, 13, 89,
|
206
|
+
11, 89, 89, 89, 89, 1, 90, 1,
|
207
|
+
4, 90, 91, 1, 92, 91, 92, 4,
|
208
|
+
91, 46, 47, 48, 46, 1, 0
|
190
209
|
]
|
191
210
|
|
192
211
|
class << self
|
@@ -194,17 +213,18 @@ class << self
|
|
194
213
|
private :_for_block_trans_targs, :_for_block_trans_targs=
|
195
214
|
end
|
196
215
|
self._for_block_trans_targs = [
|
197
|
-
2, 0, 3, 4, 5,
|
198
|
-
|
216
|
+
2, 0, 3, 4, 5, 77, 79, 6,
|
217
|
+
76, 6, 7, 8, 9, 11, 8, 9,
|
199
218
|
11, 14, 10, 12, 13, 15, 16, 19,
|
200
|
-
|
201
|
-
19, 20, 22, 19, 20, 22, 25,
|
202
|
-
23, 24, 26, 27, 28,
|
203
|
-
30, 32, 33,
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
67, 68, 70, 72,
|
219
|
+
43, 45, 17, 42, 48, 63, 17, 18,
|
220
|
+
19, 20, 34, 22, 19, 20, 22, 25,
|
221
|
+
21, 23, 24, 26, 27, 28, 82, 29,
|
222
|
+
31, 30, 32, 33, 35, 41, 36, 37,
|
223
|
+
38, 40, 39, 42, 44, 46, 47, 49,
|
224
|
+
50, 52, 60, 51, 53, 54, 56, 59,
|
225
|
+
55, 57, 58, 61, 62, 64, 65, 66,
|
226
|
+
67, 68, 69, 70, 71, 73, 72, 74,
|
227
|
+
75, 76, 78, 80, 81
|
208
228
|
]
|
209
229
|
|
210
230
|
class << self
|
@@ -212,12 +232,13 @@ class << self
|
|
212
232
|
private :_for_block_trans_actions, :_for_block_trans_actions=
|
213
233
|
end
|
214
234
|
self._for_block_trans_actions = [
|
215
|
-
0, 0, 0, 0, 0, 0, 0,
|
216
|
-
|
235
|
+
0, 0, 0, 0, 0, 0, 0, 9,
|
236
|
+
9, 0, 0, 11, 11, 11, 0, 0,
|
217
237
|
0, 0, 0, 0, 0, 0, 0, 1,
|
218
238
|
0, 0, 5, 5, 0, 5, 0, 0,
|
219
|
-
|
220
|
-
0, 0, 0, 0, 0,
|
239
|
+
7, 7, 0, 7, 0, 0, 0, 0,
|
240
|
+
0, 0, 0, 0, 0, 0, 3, 0,
|
241
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
221
242
|
0, 0, 0, 0, 0, 0, 0, 0,
|
222
243
|
0, 0, 0, 0, 0, 0, 0, 0,
|
223
244
|
0, 0, 0, 0, 0, 0, 0, 0,
|
@@ -232,7 +253,7 @@ self.for_block_start = 1;
|
|
232
253
|
class << self
|
233
254
|
attr_accessor :for_block_first_final
|
234
255
|
end
|
235
|
-
self.for_block_first_final =
|
256
|
+
self.for_block_first_final = 82;
|
236
257
|
class << self
|
237
258
|
attr_accessor :for_block_error
|
238
259
|
end
|
@@ -244,18 +265,18 @@ end
|
|
244
265
|
self.for_block_en_for_stmt = 1;
|
245
266
|
|
246
267
|
|
247
|
-
# line
|
268
|
+
# line 62 "lib/vorax/parser/grammars/for_block.rl"
|
248
269
|
|
249
|
-
# line
|
270
|
+
# line 271 "lib/vorax/parser/grammars/for_block.rb"
|
250
271
|
begin
|
251
272
|
p ||= 0
|
252
273
|
pe ||= data.length
|
253
274
|
cs = for_block_start
|
254
275
|
end
|
255
276
|
|
256
|
-
# line
|
277
|
+
# line 63 "lib/vorax/parser/grammars/for_block.rl"
|
257
278
|
|
258
|
-
# line
|
279
|
+
# line 280 "lib/vorax/parser/grammars/for_block.rb"
|
259
280
|
begin
|
260
281
|
_klen, _trans, _keys, _acts, _nacts = nil
|
261
282
|
_goto_level = 0
|
@@ -359,21 +380,27 @@ when 3 then
|
|
359
380
|
# line 20 "lib/vorax/parser/grammars/for_block.rl"
|
360
381
|
begin
|
361
382
|
|
362
|
-
@
|
383
|
+
@cursor_var_start = p
|
363
384
|
end
|
364
385
|
when 4 then
|
365
386
|
# line 24 "lib/vorax/parser/grammars/for_block.rl"
|
366
387
|
begin
|
367
388
|
|
368
|
-
|
389
|
+
@cursor_var = data[(@cursor_var_start..p-1)]
|
369
390
|
end
|
370
391
|
when 5 then
|
371
392
|
# line 28 "lib/vorax/parser/grammars/for_block.rl"
|
372
393
|
begin
|
373
394
|
|
395
|
+
@start = p
|
396
|
+
end
|
397
|
+
when 6 then
|
398
|
+
# line 32 "lib/vorax/parser/grammars/for_block.rl"
|
399
|
+
begin
|
400
|
+
|
374
401
|
@end = p - 1
|
375
402
|
end
|
376
|
-
# line
|
403
|
+
# line 404 "lib/vorax/parser/grammars/for_block.rb"
|
377
404
|
end # action switch
|
378
405
|
end
|
379
406
|
end
|
@@ -400,7 +427,7 @@ when 5 then
|
|
400
427
|
end
|
401
428
|
end
|
402
429
|
|
403
|
-
# line
|
430
|
+
# line 64 "lib/vorax/parser/grammars/for_block.rl"
|
404
431
|
end
|
405
432
|
return {:cursor_var => @cursor_var,
|
406
433
|
:for_var => @for_var,
|