hotcell 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/Rakefile +2 -2
- data/ext/lexerc/extconf.rb +1 -1
- data/ext/lexerc/lexerc.c +771 -348
- data/ext/lexerc/lexerc.h +4 -1
- data/ext/lexerc/lexerc.rl +35 -1
- data/lib/hotcell.rb +1 -1
- data/lib/hotcell/commands/for.rb +1 -1
- data/lib/hotcell/context.rb +4 -4
- data/lib/hotcell/extensions.rb +13 -13
- data/lib/hotcell/lexer.rb +21 -2
- data/lib/hotcell/lexer.rl +27 -8
- data/lib/hotcell/lexerr.rb +579 -262
- data/lib/hotcell/lexerr.rl +33 -1
- data/lib/hotcell/node/expression.rb +21 -19
- data/lib/hotcell/node/summoner.rb +1 -1
- data/lib/hotcell/parser.rb +562 -458
- data/lib/hotcell/parser.y +26 -12
- data/lib/hotcell/tong.rb +54 -0
- data/lib/hotcell/version.rb +1 -1
- data/spec/data/{sstrings → strings} +0 -0
- data/spec/lib/hotcell/commands/include_spec.rb +1 -1
- data/spec/lib/hotcell/context_spec.rb +9 -9
- data/spec/lib/hotcell/lexer_spec.rb +57 -18
- data/spec/lib/hotcell/parser_spec.rb +48 -0
- data/spec/lib/hotcell/template_spec.rb +2 -2
- data/spec/lib/hotcell/tong_spec.rb +83 -0
- metadata +8 -8
- data/lib/hotcell/manipulator.rb +0 -49
- data/spec/lib/hotcell/manipulator_spec.rb +0 -69
data/ext/lexerc/lexerc.h
CHANGED
@@ -4,11 +4,14 @@
|
|
4
4
|
#define emit_operator rb_funcall(self, rb_intern("emit_operator"), 0)
|
5
5
|
#define emit_numeric rb_funcall(self, rb_intern("emit_numeric"), 0)
|
6
6
|
#define emit_identifer rb_funcall(self, rb_intern("emit_identifer"), 0)
|
7
|
-
#define
|
7
|
+
#define emit_string rb_funcall(self, rb_intern("emit_string"), 0)
|
8
8
|
#define emit_dstring rb_funcall(self, rb_intern("emit_dstring"), 0)
|
9
|
+
#define emit_dstring_open rb_funcall(self, rb_intern("emit_dstring_open"), 0)
|
10
|
+
#define emit_dstring_close rb_funcall(self, rb_intern("emit_dstring_close"), 0)
|
9
11
|
#define emit_regexp rb_funcall(self, rb_intern("emit_regexp"), 0)
|
10
12
|
#define emit_comment rb_funcall(self, rb_intern("emit_comment"), 0)
|
11
13
|
#define emit_template rb_funcall(self, rb_intern("emit_template"), 0)
|
14
|
+
#define emit_interpolation rb_funcall(self, rb_intern("emit_interpolation"), 0)
|
12
15
|
|
13
16
|
#define raise_unterminated_string rb_funcall(self, rb_intern("raise_unterminated_string"), 0)
|
14
17
|
#define raise_unterminated_regexp rb_funcall(self, rb_intern("raise_unterminated_regexp"), 0)
|
data/ext/lexerc/lexerc.rl
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
%%{
|
2
|
-
machine
|
2
|
+
machine hotcell_lexer;
|
3
3
|
|
4
4
|
action RegexpCheck {
|
5
5
|
if (regexp_possible == Qfalse) {
|
@@ -8,6 +8,33 @@
|
|
8
8
|
}
|
9
9
|
}
|
10
10
|
|
11
|
+
action Interpolate {
|
12
|
+
braces_count = 0;
|
13
|
+
emit_interpolation;
|
14
|
+
fcall interpolation;
|
15
|
+
}
|
16
|
+
|
17
|
+
action OpenBrace {
|
18
|
+
emit_operator;
|
19
|
+
braces_count++;
|
20
|
+
}
|
21
|
+
|
22
|
+
action CloseBrace {
|
23
|
+
if (braces_count < 1) {
|
24
|
+
emit_interpolation;
|
25
|
+
fret;
|
26
|
+
} else {
|
27
|
+
emit_operator;
|
28
|
+
braces_count--;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
action ParseDstring {
|
33
|
+
dstring_start = ts - data;
|
34
|
+
emit_dstring_open;
|
35
|
+
fcall dstring;
|
36
|
+
}
|
37
|
+
|
11
38
|
include "lexer.rl";
|
12
39
|
}%%
|
13
40
|
|
@@ -25,6 +52,8 @@ static char *ts;
|
|
25
52
|
static char *te;
|
26
53
|
static char *data;
|
27
54
|
static VALUE encoding;
|
55
|
+
static int braces_count;
|
56
|
+
static long dstring_start;
|
28
57
|
|
29
58
|
static VALUE tokenize(VALUE self) {
|
30
59
|
VALUE source = rb_iv_get(self, "@source");
|
@@ -51,6 +80,11 @@ static VALUE tokenize(VALUE self) {
|
|
51
80
|
raise_unexpected_symbol;
|
52
81
|
}
|
53
82
|
|
83
|
+
if (cs == hotcell_lexer_en_dstring) {
|
84
|
+
ts = data + dstring_start;
|
85
|
+
raise_unterminated_string;
|
86
|
+
}
|
87
|
+
|
54
88
|
return rb_iv_get(self, "@token_array");
|
55
89
|
}
|
56
90
|
|
data/lib/hotcell.rb
CHANGED
data/lib/hotcell/commands/for.rb
CHANGED
data/lib/hotcell/context.rb
CHANGED
@@ -46,11 +46,11 @@ module Hotcell
|
|
46
46
|
raise e if e && options[:reraise]
|
47
47
|
end
|
48
48
|
|
49
|
-
def
|
49
|
+
def tong_invoke method, *arguments
|
50
50
|
if arguments.any?
|
51
|
-
helpers.
|
51
|
+
helpers.tong_invoke(method, *arguments)
|
52
52
|
else
|
53
|
-
scope.key?(method) ? scope[method] : helpers.
|
53
|
+
scope.key?(method) ? scope[method] : helpers.tong_invoke(method)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
@@ -61,7 +61,7 @@ module Hotcell
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def helpers_class
|
64
|
-
@helpers_class ||= Class.new(Hotcell::
|
64
|
+
@helpers_class ||= Class.new(Hotcell::Tong).tap do |klass|
|
65
65
|
options[:helpers].each { |helper| klass.send(:include, helper) }
|
66
66
|
end
|
67
67
|
end
|
data/lib/hotcell/extensions.rb
CHANGED
@@ -1,52 +1,52 @@
|
|
1
1
|
NilClass.class_eval do
|
2
|
-
include Hotcell::
|
2
|
+
include Hotcell::Tong::Mixin
|
3
3
|
end
|
4
4
|
|
5
5
|
TrueClass.class_eval do
|
6
|
-
include Hotcell::
|
6
|
+
include Hotcell::Tong::Mixin
|
7
7
|
end
|
8
8
|
|
9
9
|
FalseClass.class_eval do
|
10
|
-
include Hotcell::
|
10
|
+
include Hotcell::Tong::Mixin
|
11
11
|
end
|
12
12
|
|
13
13
|
Numeric.class_eval do
|
14
|
-
include Hotcell::
|
14
|
+
include Hotcell::Tong::Mixin
|
15
15
|
end
|
16
16
|
|
17
17
|
String.class_eval do
|
18
|
-
include Hotcell::
|
18
|
+
include Hotcell::Tong::Mixin
|
19
19
|
|
20
20
|
manipulate :size, :length
|
21
21
|
end
|
22
22
|
|
23
23
|
Regexp.class_eval do
|
24
|
-
include Hotcell::
|
24
|
+
include Hotcell::Tong::Mixin
|
25
25
|
end
|
26
26
|
|
27
27
|
Time.class_eval do
|
28
|
-
include Hotcell::
|
28
|
+
include Hotcell::Tong::Mixin
|
29
29
|
end
|
30
30
|
|
31
31
|
Date.class_eval do
|
32
|
-
include Hotcell::
|
32
|
+
include Hotcell::Tong::Mixin
|
33
33
|
end
|
34
34
|
|
35
35
|
Array.class_eval do
|
36
|
-
include Hotcell::
|
36
|
+
include Hotcell::Tong::Mixin
|
37
37
|
|
38
38
|
manipulate :first, :last, :count, :size, :length
|
39
39
|
end
|
40
40
|
|
41
41
|
Hash.class_eval do
|
42
|
-
include Hotcell::
|
42
|
+
include Hotcell::Tong::Mixin
|
43
43
|
|
44
44
|
manipulate :keys, :values, :count, :size, :length
|
45
45
|
|
46
|
-
def
|
46
|
+
def tong_invoke method, *arguments
|
47
47
|
if method == '[]'
|
48
|
-
|
49
|
-
elsif
|
48
|
+
tong_invoke_brackets *arguments
|
49
|
+
elsif tong_invokable? method
|
50
50
|
send(method, *arguments)
|
51
51
|
elsif arguments.count == 0
|
52
52
|
self[method]
|
data/lib/hotcell/lexer.rb
CHANGED
@@ -67,14 +67,28 @@ module Hotcell
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
-
def
|
70
|
+
def emit_string
|
71
71
|
emit :STRING, current_value[1..-2].gsub(SSTRING_ESCAPE_REGEXP) { |match|
|
72
72
|
SSTRING_ESCAPE_MAP[match] }
|
73
73
|
end
|
74
74
|
|
75
75
|
def emit_dstring
|
76
|
-
|
76
|
+
last = @token_array[-1]
|
77
|
+
value = current_value.gsub(DSTRING_ESCAPE_REGEXP) { |match|
|
77
78
|
DSTRING_ESCAPE_MAP[match] || match[1] }
|
79
|
+
if last && last[0] == :STRING
|
80
|
+
last[1][0] += value
|
81
|
+
else
|
82
|
+
emit :STRING, value
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def emit_dstring_open
|
87
|
+
emit :DOPEN, '"'
|
88
|
+
end
|
89
|
+
|
90
|
+
def emit_dstring_close
|
91
|
+
emit :DCLOSE, '"'
|
78
92
|
end
|
79
93
|
|
80
94
|
def regexp_ambiguity
|
@@ -127,6 +141,11 @@ module Hotcell
|
|
127
141
|
end
|
128
142
|
end
|
129
143
|
|
144
|
+
def emit_interpolation
|
145
|
+
value = current_value
|
146
|
+
emit (value == '#{' ? :IOPEN : :ICLOSE), value
|
147
|
+
end
|
148
|
+
|
130
149
|
def raise_unexpected_symbol
|
131
150
|
raise Hotcell::UnexpectedSymbol.new *current_error
|
132
151
|
end
|
data/lib/hotcell/lexer.rl
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
%%{
|
2
|
-
machine
|
2
|
+
machine hotcell_lexer;
|
3
3
|
|
4
4
|
plus = '+';
|
5
5
|
minus = '-';
|
@@ -43,11 +43,8 @@
|
|
43
43
|
|
44
44
|
squote = "'";
|
45
45
|
snon_quote = [^\\'];
|
46
|
-
|
47
|
-
|
48
|
-
dquote = '"';
|
49
|
-
dnon_quote = [^\\"];
|
50
|
-
dstring = dquote (dnon_quote | escaped_symbol)* dquote @lerr{ raise_unterminated_string; };
|
46
|
+
string_content = squote (snon_quote | escaped_symbol)* squote @lerr{ raise_unterminated_string; };
|
47
|
+
string = '""' | string_content;
|
51
48
|
|
52
49
|
rquote = '/';
|
53
50
|
rnon_quote = [^\\/];
|
@@ -69,14 +66,36 @@
|
|
69
66
|
template_comment_close = '#}}';
|
70
67
|
template_comment_body = [^\#]+ | '#';
|
71
68
|
|
69
|
+
dnon_quote = [^\\#"];
|
70
|
+
dstring_content = (dnon_quote | escaped_symbol)+ | '#';
|
71
|
+
|
72
|
+
dstring := |*
|
73
|
+
'"' => { emit_dstring_close; fret; };
|
74
|
+
'#{' => Interpolate;
|
75
|
+
dstring_content => { emit_dstring; };
|
76
|
+
*|;
|
77
|
+
|
78
|
+
interpolation_operator = operator - [{}];
|
79
|
+
|
80
|
+
interpolation := |*
|
81
|
+
interpolation_operator => { emit_operator; };
|
82
|
+
'{' => OpenBrace;
|
83
|
+
'}' => CloseBrace;
|
84
|
+
'"' => ParseDstring;
|
85
|
+
numeric => { emit_numeric; };
|
86
|
+
identifer => { emit_identifer; };
|
87
|
+
string => { emit_string; };
|
88
|
+
regexp => { emit_regexp; };
|
89
|
+
blank;
|
90
|
+
*|;
|
72
91
|
|
73
92
|
expression := |*
|
74
93
|
tag_close => { emit_tag; fret; };
|
94
|
+
'"' => ParseDstring;
|
75
95
|
operator => { emit_operator; };
|
76
96
|
numeric => { emit_numeric; };
|
77
97
|
identifer => { emit_identifer; };
|
78
|
-
|
79
|
-
dstring => { emit_dstring; };
|
98
|
+
string => { emit_string; };
|
80
99
|
regexp => { emit_regexp; };
|
81
100
|
comment => { emit_comment; };
|
82
101
|
blank;
|
data/lib/hotcell/lexerr.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
# line 1 "lib/hotcell/lexerr.rl"
|
3
3
|
|
4
|
-
# line
|
4
|
+
# line 44 "lib/hotcell/lexerr.rl"
|
5
5
|
|
6
6
|
|
7
7
|
Hotcell::Lexer.class_eval do
|
@@ -22,276 +22,387 @@ Hotcell::Lexer.class_eval do
|
|
22
22
|
|
23
23
|
# line 24 "lib/hotcell/lexerr.rb"
|
24
24
|
class << self
|
25
|
-
attr_accessor :
|
26
|
-
private :
|
25
|
+
attr_accessor :_hotcell_lexer_trans_keys
|
26
|
+
private :_hotcell_lexer_trans_keys, :_hotcell_lexer_trans_keys=
|
27
27
|
end
|
28
|
-
self.
|
29
|
-
0, 0, 32, 32,
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
self._hotcell_lexer_trans_keys = [
|
29
|
+
0, 0, 32, 32, 0, 0,
|
30
|
+
38, 38, 39, 92, 0,
|
31
|
+
0, 48, 57, 47, 92,
|
32
|
+
0, 0, 124, 124, 125, 125,
|
33
|
+
38, 38, 39, 92, 0,
|
34
|
+
0, 48, 57, 47, 92,
|
35
|
+
0, 0, 124, 124, 125, 125,
|
34
36
|
123, 123, 123, 123, 123,
|
35
|
-
33, 126,
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
123, 33, 126, 34, 92,
|
38
|
+
34, 92, 123, 123, 9, 125,
|
39
|
+
61, 61, 34, 34, 42,
|
40
|
+
42, 46, 57, 48, 57,
|
41
|
+
46, 57, 46, 46, 47, 92,
|
42
|
+
65, 122, 33, 122, 9,
|
43
|
+
125, 61, 61, 34, 34,
|
44
|
+
10, 125, 42, 42, 46, 57,
|
45
|
+
48, 57, 46, 57, 46,
|
46
|
+
46, 47, 92, 65, 122,
|
47
|
+
33, 122, 125, 125, 35, 35,
|
48
|
+
35, 35, 125, 125, 0
|
42
49
|
]
|
43
50
|
|
44
51
|
class << self
|
45
|
-
attr_accessor :
|
46
|
-
private :
|
52
|
+
attr_accessor :_hotcell_lexer_key_spans
|
53
|
+
private :_hotcell_lexer_key_spans, :_hotcell_lexer_key_spans=
|
47
54
|
end
|
48
|
-
self.
|
49
|
-
0, 1,
|
50
|
-
|
51
|
-
|
52
|
-
|
55
|
+
self._hotcell_lexer_key_spans = [
|
56
|
+
0, 1, 0, 1, 54, 0, 10, 46,
|
57
|
+
0, 1, 1, 1, 54, 0, 10, 46,
|
58
|
+
0, 1, 1, 1, 1, 1, 94, 59,
|
59
|
+
59, 1, 117, 1, 1, 1, 12, 10,
|
60
|
+
12, 1, 46, 58, 90, 117, 1, 1,
|
61
|
+
116, 1, 12, 10, 12, 1, 46, 58,
|
62
|
+
90, 1, 1, 1, 1
|
53
63
|
]
|
54
64
|
|
55
65
|
class << self
|
56
|
-
attr_accessor :
|
57
|
-
private :
|
66
|
+
attr_accessor :_hotcell_lexer_index_offsets
|
67
|
+
private :_hotcell_lexer_index_offsets, :_hotcell_lexer_index_offsets=
|
58
68
|
end
|
59
|
-
self.
|
60
|
-
0, 0, 2,
|
61
|
-
|
62
|
-
|
63
|
-
|
69
|
+
self._hotcell_lexer_index_offsets = [
|
70
|
+
0, 0, 2, 3, 5, 60, 61, 72,
|
71
|
+
119, 120, 122, 124, 126, 181, 182, 193,
|
72
|
+
240, 241, 243, 245, 247, 249, 251, 346,
|
73
|
+
406, 466, 468, 586, 588, 590, 592, 605,
|
74
|
+
616, 629, 631, 678, 737, 828, 946, 948,
|
75
|
+
950, 1067, 1069, 1082, 1093, 1106, 1108, 1155,
|
76
|
+
1214, 1305, 1307, 1309, 1311
|
64
77
|
]
|
65
78
|
|
66
79
|
class << self
|
67
|
-
attr_accessor :
|
68
|
-
private :
|
80
|
+
attr_accessor :_hotcell_lexer_indicies
|
81
|
+
private :_hotcell_lexer_indicies, :_hotcell_lexer_indicies=
|
69
82
|
end
|
70
|
-
self.
|
71
|
-
1, 0, 3,
|
72
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
73
|
-
2, 2, 2, 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, 4, 2, 2, 5,
|
79
|
-
6, 7, 8, 10, 9, 9, 9, 9,
|
80
|
-
9, 9, 9, 9, 9, 9, 9, 9,
|
81
|
-
9, 9, 9, 9, 9, 9, 9, 9,
|
82
|
-
9, 9, 9, 9, 9, 9, 9, 9,
|
83
|
-
9, 9, 9, 9, 9, 9, 9, 9,
|
84
|
-
9, 9, 9, 9, 9, 9, 9, 9,
|
85
|
-
9, 9, 9, 9, 9, 9, 9, 9,
|
86
|
-
11, 9, 9, 13, 13, 13, 13, 13,
|
87
|
-
13, 13, 13, 13, 13, 12, 16, 15,
|
88
|
-
15, 15, 15, 15, 15, 15, 15, 15,
|
89
|
-
15, 15, 15, 15, 15, 15, 15, 15,
|
90
|
-
15, 15, 15, 15, 15, 15, 15, 15,
|
91
|
-
15, 15, 15, 15, 15, 15, 15, 15,
|
92
|
-
15, 15, 15, 15, 15, 15, 15, 15,
|
93
|
-
15, 15, 15, 17, 15, 15, 7, 8,
|
94
|
-
19, 18, 21, 20, 22, 20, 23, 22,
|
95
|
-
1, 24, 25, 24, 24, 24, 24, 24,
|
96
|
-
24, 24, 24, 24, 24, 24, 24, 24,
|
97
|
-
24, 24, 24, 24, 24, 24, 24, 24,
|
98
|
-
24, 24, 24, 24, 24, 24, 24, 24,
|
99
|
-
24, 24, 24, 24, 24, 24, 24, 24,
|
100
|
-
24, 24, 24, 24, 24, 24, 24, 24,
|
101
|
-
24, 24, 24, 24, 24, 24, 24, 24,
|
102
|
-
24, 24, 24, 24, 24, 1, 24, 24,
|
103
|
-
24, 24, 24, 24, 26, 24, 24, 24,
|
104
|
-
24, 24, 24, 24, 24, 24, 24, 24,
|
105
|
-
24, 26, 24, 24, 24, 24, 24, 24,
|
106
|
-
24, 24, 24, 24, 24, 1, 24, 27,
|
107
|
-
7, 27, 27, 27, 8, 8, 8, 8,
|
108
|
-
8, 8, 8, 8, 8, 8, 8, 8,
|
109
|
-
8, 8, 8, 8, 8, 8, 27, 28,
|
110
|
-
2, 6, 8, 7, 29, 9, 7, 7,
|
111
|
-
30, 7, 7, 31, 32, 33, 34, 34,
|
112
|
-
34, 34, 34, 34, 34, 34, 34, 34,
|
113
|
-
7, 7, 28, 28, 28, 7, 8, 35,
|
114
|
-
35, 35, 35, 35, 35, 35, 35, 35,
|
115
|
-
35, 35, 35, 35, 35, 35, 35, 35,
|
116
|
-
35, 35, 35, 35, 35, 35, 35, 35,
|
117
|
-
35, 7, 8, 7, 8, 35, 8, 35,
|
118
|
-
35, 35, 35, 35, 35, 35, 35, 35,
|
119
|
-
35, 35, 35, 35, 35, 35, 35, 35,
|
120
|
-
35, 35, 35, 35, 35, 35, 35, 35,
|
121
|
-
35, 7, 36, 37, 8, 7, 38, 39,
|
122
|
-
6, 6, 6, 6, 6, 6, 6, 6,
|
83
|
+
self._hotcell_lexer_indicies = [
|
84
|
+
1, 0, 3, 4, 5, 7, 6, 6,
|
123
85
|
6, 6, 6, 6, 6, 6, 6, 6,
|
124
86
|
6, 6, 6, 6, 6, 6, 6, 6,
|
125
87
|
6, 6, 6, 6, 6, 6, 6, 6,
|
126
88
|
6, 6, 6, 6, 6, 6, 6, 6,
|
127
89
|
6, 6, 6, 6, 6, 6, 6, 6,
|
128
90
|
6, 6, 6, 6, 6, 6, 6, 6,
|
129
|
-
6, 6,
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
91
|
+
6, 6, 8, 6, 6, 10, 10, 10,
|
92
|
+
10, 10, 10, 10, 10, 10, 10, 9,
|
93
|
+
13, 12, 12, 12, 12, 12, 12, 12,
|
94
|
+
12, 12, 12, 12, 12, 12, 12, 12,
|
95
|
+
12, 12, 12, 12, 12, 12, 12, 12,
|
96
|
+
12, 12, 12, 12, 12, 12, 12, 12,
|
97
|
+
12, 12, 12, 12, 12, 12, 12, 12,
|
98
|
+
12, 12, 12, 12, 12, 14, 12, 12,
|
99
|
+
4, 5, 15, 16, 17, 5, 19, 18,
|
100
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
101
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
102
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
103
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
104
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
105
|
+
18, 18, 18, 18, 18, 18, 18, 18,
|
106
|
+
18, 18, 18, 20, 18, 18, 22, 22,
|
107
|
+
22, 22, 22, 22, 22, 22, 22, 22,
|
108
|
+
21, 25, 24, 24, 24, 24, 24, 24,
|
109
|
+
24, 24, 24, 24, 24, 24, 24, 24,
|
110
|
+
24, 24, 24, 24, 24, 24, 24, 24,
|
111
|
+
24, 24, 24, 24, 24, 24, 24, 24,
|
112
|
+
24, 24, 24, 24, 24, 24, 24, 24,
|
113
|
+
24, 24, 24, 24, 24, 24, 26, 24,
|
114
|
+
24, 17, 5, 28, 27, 30, 29, 31,
|
115
|
+
29, 32, 31, 1, 33, 34, 33, 33,
|
116
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
117
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
118
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
119
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
120
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
121
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
122
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
123
|
+
1, 33, 33, 33, 33, 33, 33, 35,
|
124
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
125
|
+
33, 33, 33, 33, 35, 33, 33, 33,
|
126
|
+
33, 33, 33, 33, 33, 33, 33, 33,
|
127
|
+
1, 33, 36, 37, 3, 3, 3, 3,
|
128
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
129
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
130
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
131
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
132
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
133
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
134
|
+
3, 3, 3, 3, 38, 3, 39, 39,
|
135
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
136
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
137
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
138
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
139
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
140
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
141
|
+
3, 3, 3, 3, 3, 3, 3, 3,
|
142
|
+
38, 3, 40, 39, 41, 4, 41, 41,
|
143
|
+
41, 5, 5, 5, 5, 5, 5, 5,
|
144
|
+
5, 5, 5, 5, 5, 5, 5, 5,
|
145
|
+
5, 5, 5, 41, 42, 43, 5, 5,
|
146
|
+
4, 44, 6, 4, 4, 45, 4, 4,
|
147
|
+
46, 47, 48, 49, 49, 49, 49, 49,
|
148
|
+
49, 49, 49, 49, 49, 4, 4, 42,
|
149
|
+
42, 42, 4, 5, 50, 50, 50, 50,
|
150
|
+
50, 50, 50, 50, 50, 50, 50, 50,
|
151
|
+
50, 50, 50, 50, 50, 50, 50, 50,
|
152
|
+
50, 50, 50, 50, 50, 50, 4, 5,
|
153
|
+
4, 5, 50, 5, 50, 50, 50, 50,
|
154
|
+
50, 50, 50, 50, 50, 50, 50, 50,
|
155
|
+
50, 50, 50, 50, 50, 50, 50, 50,
|
156
|
+
50, 50, 50, 50, 50, 50, 51, 52,
|
157
|
+
53, 5, 4, 54, 7, 55, 4, 54,
|
158
|
+
56, 9, 49, 49, 49, 49, 49, 49,
|
159
|
+
49, 49, 49, 49, 9, 10, 10, 10,
|
160
|
+
10, 10, 10, 10, 10, 10, 10, 57,
|
161
|
+
58, 54, 10, 10, 10, 10, 10, 10,
|
162
|
+
10, 10, 10, 10, 54, 4, 54, 13,
|
163
|
+
12, 12, 12, 12, 12, 12, 12, 12,
|
164
|
+
12, 12, 12, 12, 12, 12, 12, 12,
|
165
|
+
12, 12, 12, 12, 12, 12, 12, 12,
|
166
|
+
12, 12, 12, 12, 12, 12, 12, 12,
|
167
|
+
12, 12, 12, 12, 12, 12, 12, 12,
|
168
|
+
12, 12, 12, 12, 14, 12, 13, 13,
|
169
|
+
13, 13, 13, 13, 13, 13, 13, 13,
|
170
|
+
13, 13, 13, 13, 13, 13, 13, 13,
|
171
|
+
13, 13, 13, 13, 13, 13, 13, 13,
|
172
|
+
59, 59, 59, 59, 59, 59, 13, 13,
|
173
|
+
13, 13, 13, 13, 13, 13, 13, 13,
|
174
|
+
13, 13, 13, 13, 13, 13, 13, 13,
|
140
175
|
13, 13, 13, 13, 13, 13, 13, 13,
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
176
|
+
59, 61, 60, 60, 60, 60, 60, 60,
|
177
|
+
60, 60, 60, 60, 60, 60, 60, 60,
|
178
|
+
50, 50, 50, 50, 50, 50, 50, 50,
|
179
|
+
50, 50, 60, 60, 60, 60, 60, 61,
|
180
|
+
60, 50, 50, 50, 50, 50, 50, 50,
|
181
|
+
50, 50, 50, 50, 50, 50, 50, 50,
|
182
|
+
50, 50, 50, 50, 50, 50, 50, 50,
|
183
|
+
50, 50, 50, 60, 60, 60, 60, 50,
|
184
|
+
60, 50, 50, 50, 50, 50, 50, 50,
|
185
|
+
50, 50, 50, 50, 50, 50, 50, 50,
|
186
|
+
50, 50, 50, 50, 50, 50, 50, 50,
|
187
|
+
50, 50, 50, 60, 62, 17, 62, 62,
|
188
|
+
62, 5, 5, 5, 5, 5, 5, 5,
|
189
|
+
5, 5, 5, 5, 5, 5, 5, 5,
|
190
|
+
5, 5, 5, 62, 63, 64, 16, 5,
|
191
|
+
17, 65, 18, 17, 17, 66, 17, 17,
|
192
|
+
67, 68, 69, 70, 70, 70, 70, 70,
|
193
|
+
70, 70, 70, 70, 70, 17, 17, 63,
|
194
|
+
63, 63, 17, 5, 71, 71, 71, 71,
|
195
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
196
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
197
|
+
71, 71, 71, 71, 71, 71, 17, 5,
|
198
|
+
17, 5, 71, 5, 71, 71, 71, 71,
|
199
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
200
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
201
|
+
71, 71, 71, 71, 71, 71, 17, 72,
|
202
|
+
73, 5, 17, 74, 19, 75, 76, 16,
|
203
|
+
16, 16, 16, 16, 16, 16, 16, 16,
|
204
|
+
16, 16, 16, 16, 16, 16, 16, 16,
|
205
|
+
16, 16, 16, 16, 16, 16, 16, 16,
|
206
|
+
16, 16, 16, 16, 16, 16, 16, 16,
|
207
|
+
16, 16, 16, 16, 16, 16, 16, 16,
|
208
|
+
16, 16, 16, 16, 16, 16, 16, 16,
|
209
|
+
16, 16, 16, 16, 16, 16, 16, 16,
|
210
|
+
16, 16, 16, 16, 16, 16, 16, 16,
|
148
211
|
16, 16, 16, 16, 16, 16, 16, 16,
|
149
212
|
16, 16, 16, 16, 16, 16, 16, 16,
|
150
|
-
16, 16, 16, 16, 16, 16, 44, 44,
|
151
|
-
44, 44, 44, 44, 16, 16, 16, 16,
|
152
213
|
16, 16, 16, 16, 16, 16, 16, 16,
|
153
214
|
16, 16, 16, 16, 16, 16, 16, 16,
|
154
|
-
16, 16, 16, 16, 16, 16,
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
215
|
+
16, 16, 16, 16, 16, 16, 16, 16,
|
216
|
+
16, 16, 16, 16, 16, 16, 16, 16,
|
217
|
+
16, 77, 16, 17, 74, 78, 21, 70,
|
218
|
+
70, 70, 70, 70, 70, 70, 70, 70,
|
219
|
+
70, 21, 22, 22, 22, 22, 22, 22,
|
220
|
+
22, 22, 22, 22, 79, 80, 74, 22,
|
221
|
+
22, 22, 22, 22, 22, 22, 22, 22,
|
222
|
+
22, 74, 17, 74, 25, 24, 24, 24,
|
223
|
+
24, 24, 24, 24, 24, 24, 24, 24,
|
224
|
+
24, 24, 24, 24, 24, 24, 24, 24,
|
225
|
+
24, 24, 24, 24, 24, 24, 24, 24,
|
226
|
+
24, 24, 24, 24, 24, 24, 24, 24,
|
227
|
+
24, 24, 24, 24, 24, 24, 24, 24,
|
228
|
+
24, 26, 24, 25, 25, 25, 25, 25,
|
229
|
+
25, 25, 25, 25, 25, 25, 25, 25,
|
230
|
+
25, 25, 25, 25, 25, 25, 25, 25,
|
231
|
+
25, 25, 25, 25, 25, 81, 81, 81,
|
232
|
+
81, 81, 81, 25, 25, 25, 25, 25,
|
233
|
+
25, 25, 25, 25, 25, 25, 25, 25,
|
234
|
+
25, 25, 25, 25, 25, 25, 25, 25,
|
235
|
+
25, 25, 25, 25, 25, 81, 83, 82,
|
236
|
+
82, 82, 82, 82, 82, 82, 82, 82,
|
237
|
+
82, 82, 82, 82, 82, 71, 71, 71,
|
238
|
+
71, 71, 71, 71, 71, 71, 71, 82,
|
239
|
+
82, 82, 82, 82, 83, 82, 71, 71,
|
240
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
241
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
242
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
243
|
+
82, 82, 82, 82, 71, 82, 71, 71,
|
244
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
245
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
246
|
+
71, 71, 71, 71, 71, 71, 71, 71,
|
247
|
+
82, 84, 74, 86, 85, 87, 85, 88,
|
248
|
+
87, 0
|
168
249
|
]
|
169
250
|
|
170
251
|
class << self
|
171
|
-
attr_accessor :
|
172
|
-
private :
|
252
|
+
attr_accessor :_hotcell_lexer_trans_targs
|
253
|
+
private :_hotcell_lexer_trans_targs, :_hotcell_lexer_trans_targs=
|
173
254
|
end
|
174
|
-
self.
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
30,
|
255
|
+
self._hotcell_lexer_trans_targs = [
|
256
|
+
19, 19, 23, 24, 26, 0, 4, 26,
|
257
|
+
5, 26, 31, 26, 7, 35, 8, 37,
|
258
|
+
40, 37, 12, 37, 13, 37, 43, 37,
|
259
|
+
15, 47, 16, 50, 50, 20, 21, 19,
|
260
|
+
22, 19, 19, 1, 23, 25, 2, 23,
|
261
|
+
23, 26, 27, 28, 3, 29, 30, 32,
|
262
|
+
34, 30, 36, 26, 9, 26, 26, 26,
|
263
|
+
6, 26, 33, 26, 26, 26, 37, 38,
|
264
|
+
39, 11, 41, 42, 44, 46, 42, 48,
|
265
|
+
17, 49, 37, 37, 37, 10, 14, 37,
|
266
|
+
45, 37, 37, 37, 37, 51, 52, 50,
|
267
|
+
18
|
182
268
|
]
|
183
269
|
|
184
270
|
class << self
|
185
|
-
attr_accessor :
|
186
|
-
private :
|
271
|
+
attr_accessor :_hotcell_lexer_trans_actions
|
272
|
+
private :_hotcell_lexer_trans_actions, :_hotcell_lexer_trans_actions=
|
187
273
|
end
|
188
|
-
self.
|
189
|
-
1, 2,
|
190
|
-
0, 0, 9, 0,
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
0,
|
274
|
+
self._hotcell_lexer_trans_actions = [
|
275
|
+
1, 2, 3, 4, 5, 0, 0, 7,
|
276
|
+
0, 8, 0, 9, 0, 0, 0, 10,
|
277
|
+
11, 12, 0, 13, 0, 14, 0, 15,
|
278
|
+
0, 0, 0, 16, 17, 0, 0, 20,
|
279
|
+
11, 21, 22, 0, 24, 0, 0, 25,
|
280
|
+
26, 27, 0, 0, 0, 0, 28, 0,
|
281
|
+
29, 30, 0, 31, 0, 32, 33, 34,
|
282
|
+
0, 35, 0, 36, 37, 38, 39, 0,
|
283
|
+
0, 0, 0, 40, 0, 29, 41, 0,
|
284
|
+
0, 0, 42, 43, 44, 0, 0, 45,
|
285
|
+
0, 46, 47, 48, 49, 0, 11, 50,
|
286
|
+
0
|
196
287
|
]
|
197
288
|
|
198
289
|
class << self
|
199
|
-
attr_accessor :
|
200
|
-
private :
|
290
|
+
attr_accessor :_hotcell_lexer_to_state_actions
|
291
|
+
private :_hotcell_lexer_to_state_actions, :_hotcell_lexer_to_state_actions=
|
201
292
|
end
|
202
|
-
self.
|
293
|
+
self._hotcell_lexer_to_state_actions = [
|
203
294
|
0, 0, 0, 0, 0, 0, 0, 0,
|
204
|
-
0, 0, 0, 0, 0,
|
205
|
-
0,
|
206
|
-
0, 0, 0, 0, 0,
|
295
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
296
|
+
0, 0, 0, 18, 0, 0, 0, 23,
|
297
|
+
0, 0, 18, 0, 0, 0, 0, 0,
|
298
|
+
0, 0, 0, 0, 0, 18, 0, 0,
|
299
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
300
|
+
0, 0, 18, 0, 0
|
207
301
|
]
|
208
302
|
|
209
303
|
class << self
|
210
|
-
attr_accessor :
|
211
|
-
private :
|
304
|
+
attr_accessor :_hotcell_lexer_from_state_actions
|
305
|
+
private :_hotcell_lexer_from_state_actions, :_hotcell_lexer_from_state_actions=
|
212
306
|
end
|
213
|
-
self.
|
307
|
+
self._hotcell_lexer_from_state_actions = [
|
308
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
309
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
310
|
+
0, 0, 0, 19, 0, 0, 0, 19,
|
311
|
+
0, 0, 19, 0, 0, 0, 0, 0,
|
312
|
+
0, 0, 0, 0, 0, 19, 0, 0,
|
214
313
|
0, 0, 0, 0, 0, 0, 0, 0,
|
215
|
-
0, 0,
|
216
|
-
0, 15, 0, 0, 0, 0, 0, 0,
|
217
|
-
0, 0, 0, 0, 0, 15, 0, 0
|
314
|
+
0, 0, 19, 0, 0
|
218
315
|
]
|
219
316
|
|
220
317
|
class << self
|
221
|
-
attr_accessor :
|
222
|
-
private :
|
318
|
+
attr_accessor :_hotcell_lexer_eof_actions
|
319
|
+
private :_hotcell_lexer_eof_actions, :_hotcell_lexer_eof_actions=
|
223
320
|
end
|
224
|
-
self.
|
225
|
-
0, 0,
|
321
|
+
self._hotcell_lexer_eof_actions = [
|
322
|
+
0, 0, 0, 0, 6, 0, 0, 0,
|
323
|
+
0, 0, 0, 0, 6, 0, 0, 0,
|
226
324
|
0, 0, 0, 0, 0, 0, 0, 0,
|
227
325
|
0, 0, 0, 0, 0, 0, 0, 0,
|
228
|
-
0, 0, 0, 0, 0, 0, 0, 0
|
326
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
327
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
328
|
+
0, 0, 0, 0, 0
|
229
329
|
]
|
230
330
|
|
231
331
|
class << self
|
232
|
-
attr_accessor :
|
233
|
-
private :
|
332
|
+
attr_accessor :_hotcell_lexer_eof_trans
|
333
|
+
private :_hotcell_lexer_eof_trans, :_hotcell_lexer_eof_trans=
|
234
334
|
end
|
235
|
-
self.
|
236
|
-
0, 1,
|
237
|
-
|
238
|
-
|
239
|
-
|
335
|
+
self._hotcell_lexer_eof_trans = [
|
336
|
+
0, 1, 3, 0, 0, 0, 10, 12,
|
337
|
+
12, 0, 16, 0, 0, 0, 22, 24,
|
338
|
+
24, 0, 28, 0, 32, 32, 34, 0,
|
339
|
+
40, 40, 0, 55, 56, 55, 10, 58,
|
340
|
+
55, 55, 55, 60, 61, 0, 75, 76,
|
341
|
+
77, 75, 22, 80, 75, 75, 75, 82,
|
342
|
+
83, 75, 0, 88, 88
|
240
343
|
]
|
241
344
|
|
242
345
|
class << self
|
243
|
-
attr_accessor :
|
346
|
+
attr_accessor :hotcell_lexer_start
|
244
347
|
end
|
245
|
-
self.
|
348
|
+
self.hotcell_lexer_start = 19;
|
246
349
|
class << self
|
247
|
-
attr_accessor :
|
350
|
+
attr_accessor :hotcell_lexer_first_final
|
248
351
|
end
|
249
|
-
self.
|
352
|
+
self.hotcell_lexer_first_final = 19;
|
250
353
|
class << self
|
251
|
-
attr_accessor :
|
354
|
+
attr_accessor :hotcell_lexer_error
|
252
355
|
end
|
253
|
-
self.
|
356
|
+
self.hotcell_lexer_error = 0;
|
254
357
|
|
255
358
|
class << self
|
256
|
-
attr_accessor :
|
359
|
+
attr_accessor :hotcell_lexer_en_dstring
|
360
|
+
end
|
361
|
+
self.hotcell_lexer_en_dstring = 23;
|
362
|
+
class << self
|
363
|
+
attr_accessor :hotcell_lexer_en_interpolation
|
257
364
|
end
|
258
|
-
self.
|
365
|
+
self.hotcell_lexer_en_interpolation = 26;
|
259
366
|
class << self
|
260
|
-
attr_accessor :
|
367
|
+
attr_accessor :hotcell_lexer_en_expression
|
261
368
|
end
|
262
|
-
self.
|
369
|
+
self.hotcell_lexer_en_expression = 37;
|
263
370
|
class << self
|
264
|
-
attr_accessor :
|
371
|
+
attr_accessor :hotcell_lexer_en_template_comment
|
265
372
|
end
|
266
|
-
self.
|
373
|
+
self.hotcell_lexer_en_template_comment = 50;
|
374
|
+
class << self
|
375
|
+
attr_accessor :hotcell_lexer_en_main
|
376
|
+
end
|
377
|
+
self.hotcell_lexer_en_main = 19;
|
267
378
|
|
268
379
|
|
269
|
-
# line
|
380
|
+
# line 62 "lib/hotcell/lexerr.rl"
|
270
381
|
#%
|
271
382
|
|
272
383
|
@data = @source.data
|
273
384
|
@token_array = []
|
274
385
|
|
275
386
|
|
276
|
-
# line
|
387
|
+
# line 388 "lib/hotcell/lexerr.rb"
|
277
388
|
begin
|
278
389
|
@p ||= 0
|
279
390
|
pe ||= @data.length
|
280
|
-
cs =
|
391
|
+
cs = hotcell_lexer_start
|
281
392
|
top = 0
|
282
393
|
@ts = nil
|
283
394
|
@te = nil
|
284
395
|
act = 0
|
285
396
|
end
|
286
397
|
|
287
|
-
# line
|
398
|
+
# line 68 "lib/hotcell/lexerr.rl"
|
288
399
|
#%
|
289
400
|
|
290
401
|
eof = pe
|
291
402
|
stack = []
|
292
403
|
|
293
404
|
|
294
|
-
# line
|
405
|
+
# line 406 "lib/hotcell/lexerr.rb"
|
295
406
|
begin
|
296
407
|
testEof = false
|
297
408
|
_slen, _trans, _keys, _inds, _acts, _nacts = nil
|
@@ -313,40 +424,40 @@ begin
|
|
313
424
|
end
|
314
425
|
end
|
315
426
|
if _goto_level <= _resume
|
316
|
-
case
|
317
|
-
when
|
427
|
+
case _hotcell_lexer_from_state_actions[cs]
|
428
|
+
when 19 then
|
318
429
|
# line 1 "NONE"
|
319
430
|
begin
|
320
431
|
@ts = @p
|
321
432
|
end
|
322
|
-
# line
|
433
|
+
# line 434 "lib/hotcell/lexerr.rb"
|
323
434
|
end
|
324
435
|
_keys = cs << 1
|
325
|
-
_inds =
|
326
|
-
_slen =
|
436
|
+
_inds = _hotcell_lexer_index_offsets[cs]
|
437
|
+
_slen = _hotcell_lexer_key_spans[cs]
|
327
438
|
_trans = if ( _slen > 0 &&
|
328
|
-
|
329
|
-
@data[ @p].ord <=
|
439
|
+
_hotcell_lexer_trans_keys[_keys] <= @data[ @p].ord &&
|
440
|
+
@data[ @p].ord <= _hotcell_lexer_trans_keys[_keys + 1]
|
330
441
|
) then
|
331
|
-
|
442
|
+
_hotcell_lexer_indicies[ _inds + @data[ @p].ord - _hotcell_lexer_trans_keys[_keys] ]
|
332
443
|
else
|
333
|
-
|
444
|
+
_hotcell_lexer_indicies[ _inds + _slen ]
|
334
445
|
end
|
335
446
|
end
|
336
447
|
if _goto_level <= _eof_trans
|
337
|
-
cs =
|
338
|
-
if
|
339
|
-
case
|
340
|
-
when
|
448
|
+
cs = _hotcell_lexer_trans_targs[_trans]
|
449
|
+
if _hotcell_lexer_trans_actions[_trans] != 0
|
450
|
+
case _hotcell_lexer_trans_actions[_trans]
|
451
|
+
when 11 then
|
341
452
|
# line 1 "NONE"
|
342
453
|
begin
|
343
454
|
@te = @p+1
|
344
455
|
end
|
345
|
-
when
|
346
|
-
# line
|
456
|
+
when 24 then
|
457
|
+
# line 73 "lib/hotcell/lexer.rl"
|
347
458
|
begin
|
348
459
|
@te = @p+1
|
349
|
-
begin
|
460
|
+
begin emit_dstring_close; begin
|
350
461
|
top -= 1
|
351
462
|
cs = stack[top]
|
352
463
|
_goto_level = _again
|
@@ -354,91 +465,264 @@ begin
|
|
354
465
|
end
|
355
466
|
end
|
356
467
|
end
|
357
|
-
when
|
468
|
+
when 26 then
|
469
|
+
# line 16 "lib/hotcell/lexerr.rl"
|
470
|
+
begin
|
471
|
+
@te = @p+1
|
472
|
+
begin
|
473
|
+
@braces_count = 0;
|
474
|
+
emit_interpolation
|
475
|
+
begin
|
476
|
+
stack[top] = cs
|
477
|
+
top+= 1
|
478
|
+
cs = 26
|
479
|
+
_goto_level = _again
|
480
|
+
next
|
481
|
+
end
|
482
|
+
|
483
|
+
end
|
484
|
+
end
|
485
|
+
when 25 then
|
358
486
|
# line 75 "lib/hotcell/lexer.rl"
|
359
487
|
begin
|
488
|
+
@te = @p
|
489
|
+
@p = @p - 1; begin emit_dstring; end
|
490
|
+
end
|
491
|
+
when 3 then
|
492
|
+
# line 1 "NONE"
|
493
|
+
begin
|
494
|
+
case act
|
495
|
+
when 0 then
|
496
|
+
begin begin
|
497
|
+
cs = 0
|
498
|
+
_goto_level = _again
|
499
|
+
next
|
500
|
+
end
|
501
|
+
end
|
502
|
+
when 3 then
|
503
|
+
begin begin @p = (( @te))-1; end
|
504
|
+
emit_dstring; end
|
505
|
+
end
|
506
|
+
end
|
507
|
+
when 5 then
|
508
|
+
# line 81 "lib/hotcell/lexer.rl"
|
509
|
+
begin
|
360
510
|
@te = @p+1
|
361
511
|
begin emit_operator; end
|
362
512
|
end
|
363
|
-
when
|
364
|
-
# line
|
513
|
+
when 31 then
|
514
|
+
# line 22 "lib/hotcell/lexerr.rl"
|
515
|
+
begin
|
516
|
+
@te = @p+1
|
517
|
+
begin
|
518
|
+
emit_operator
|
519
|
+
@braces_count += 1
|
520
|
+
end
|
521
|
+
end
|
522
|
+
when 32 then
|
523
|
+
# line 27 "lib/hotcell/lexerr.rl"
|
524
|
+
begin
|
525
|
+
@te = @p+1
|
526
|
+
begin
|
527
|
+
if @braces_count < 1
|
528
|
+
emit_interpolation
|
529
|
+
begin
|
530
|
+
top -= 1
|
531
|
+
cs = stack[top]
|
532
|
+
_goto_level = _again
|
533
|
+
next
|
534
|
+
end
|
535
|
+
|
536
|
+
else
|
537
|
+
emit_operator
|
538
|
+
@braces_count -= 1
|
539
|
+
end
|
540
|
+
end
|
541
|
+
end
|
542
|
+
when 38 then
|
543
|
+
# line 86 "lib/hotcell/lexer.rl"
|
365
544
|
begin
|
366
545
|
@te = @p+1
|
367
546
|
begin emit_identifer; end
|
368
547
|
end
|
369
|
-
when
|
370
|
-
# line
|
548
|
+
when 7 then
|
549
|
+
# line 87 "lib/hotcell/lexer.rl"
|
371
550
|
begin
|
372
551
|
@te = @p+1
|
373
|
-
begin
|
552
|
+
begin emit_string; end
|
553
|
+
end
|
554
|
+
when 27 then
|
555
|
+
# line 89 "lib/hotcell/lexer.rl"
|
556
|
+
begin
|
557
|
+
@te = @p+1
|
558
|
+
end
|
559
|
+
when 33 then
|
560
|
+
# line 81 "lib/hotcell/lexer.rl"
|
561
|
+
begin
|
562
|
+
@te = @p
|
563
|
+
@p = @p - 1; begin emit_operator; end
|
564
|
+
end
|
565
|
+
when 34 then
|
566
|
+
# line 37 "lib/hotcell/lexerr.rl"
|
567
|
+
begin
|
568
|
+
@te = @p
|
569
|
+
@p = @p - 1; begin
|
570
|
+
@dstring_start = @ts
|
571
|
+
emit_dstring_open
|
572
|
+
begin
|
573
|
+
stack[top] = cs
|
574
|
+
top+= 1
|
575
|
+
cs = 23
|
576
|
+
_goto_level = _again
|
577
|
+
next
|
578
|
+
end
|
579
|
+
|
580
|
+
end
|
581
|
+
end
|
582
|
+
when 35 then
|
583
|
+
# line 85 "lib/hotcell/lexer.rl"
|
584
|
+
begin
|
585
|
+
@te = @p
|
586
|
+
@p = @p - 1; begin emit_numeric; end
|
587
|
+
end
|
588
|
+
when 37 then
|
589
|
+
# line 86 "lib/hotcell/lexer.rl"
|
590
|
+
begin
|
591
|
+
@te = @p
|
592
|
+
@p = @p - 1; begin emit_identifer; end
|
374
593
|
end
|
594
|
+
when 36 then
|
595
|
+
# line 88 "lib/hotcell/lexer.rl"
|
596
|
+
begin
|
597
|
+
@te = @p
|
598
|
+
@p = @p - 1; begin emit_regexp; end
|
599
|
+
end
|
600
|
+
when 9 then
|
601
|
+
# line 81 "lib/hotcell/lexer.rl"
|
602
|
+
begin
|
603
|
+
begin @p = (( @te))-1; end
|
604
|
+
begin emit_operator; end
|
605
|
+
end
|
606
|
+
when 8 then
|
607
|
+
# line 1 "NONE"
|
608
|
+
begin
|
609
|
+
case act
|
375
610
|
when 4 then
|
376
|
-
|
611
|
+
begin begin @p = (( @te))-1; end
|
612
|
+
emit_operator; end
|
613
|
+
when 8 then
|
614
|
+
begin begin @p = (( @te))-1; end
|
615
|
+
emit_numeric; end
|
616
|
+
end
|
617
|
+
end
|
618
|
+
when 49 then
|
619
|
+
# line 93 "lib/hotcell/lexer.rl"
|
377
620
|
begin
|
378
621
|
@te = @p+1
|
379
|
-
begin
|
622
|
+
begin emit_tag; begin
|
623
|
+
top -= 1
|
624
|
+
cs = stack[top]
|
625
|
+
_goto_level = _again
|
626
|
+
next
|
627
|
+
end
|
628
|
+
end
|
380
629
|
end
|
381
|
-
when
|
382
|
-
# line
|
630
|
+
when 12 then
|
631
|
+
# line 95 "lib/hotcell/lexer.rl"
|
383
632
|
begin
|
384
633
|
@te = @p+1
|
634
|
+
begin emit_operator; end
|
385
635
|
end
|
386
|
-
when
|
387
|
-
# line
|
636
|
+
when 48 then
|
637
|
+
# line 97 "lib/hotcell/lexer.rl"
|
638
|
+
begin
|
639
|
+
@te = @p+1
|
640
|
+
begin emit_identifer; end
|
641
|
+
end
|
642
|
+
when 13 then
|
643
|
+
# line 98 "lib/hotcell/lexer.rl"
|
644
|
+
begin
|
645
|
+
@te = @p+1
|
646
|
+
begin emit_string; end
|
647
|
+
end
|
648
|
+
when 39 then
|
649
|
+
# line 101 "lib/hotcell/lexer.rl"
|
650
|
+
begin
|
651
|
+
@te = @p+1
|
652
|
+
end
|
653
|
+
when 43 then
|
654
|
+
# line 37 "lib/hotcell/lexerr.rl"
|
655
|
+
begin
|
656
|
+
@te = @p
|
657
|
+
@p = @p - 1; begin
|
658
|
+
@dstring_start = @ts
|
659
|
+
emit_dstring_open
|
660
|
+
begin
|
661
|
+
stack[top] = cs
|
662
|
+
top+= 1
|
663
|
+
cs = 23
|
664
|
+
_goto_level = _again
|
665
|
+
next
|
666
|
+
end
|
667
|
+
|
668
|
+
end
|
669
|
+
end
|
670
|
+
when 42 then
|
671
|
+
# line 95 "lib/hotcell/lexer.rl"
|
388
672
|
begin
|
389
673
|
@te = @p
|
390
674
|
@p = @p - 1; begin emit_operator; end
|
391
675
|
end
|
392
|
-
when
|
393
|
-
# line
|
676
|
+
when 45 then
|
677
|
+
# line 96 "lib/hotcell/lexer.rl"
|
394
678
|
begin
|
395
679
|
@te = @p
|
396
680
|
@p = @p - 1; begin emit_numeric; end
|
397
681
|
end
|
398
|
-
when
|
399
|
-
# line
|
682
|
+
when 47 then
|
683
|
+
# line 97 "lib/hotcell/lexer.rl"
|
400
684
|
begin
|
401
685
|
@te = @p
|
402
686
|
@p = @p - 1; begin emit_identifer; end
|
403
687
|
end
|
404
|
-
when
|
405
|
-
# line
|
688
|
+
when 46 then
|
689
|
+
# line 99 "lib/hotcell/lexer.rl"
|
406
690
|
begin
|
407
691
|
@te = @p
|
408
692
|
@p = @p - 1; begin emit_regexp; end
|
409
693
|
end
|
410
|
-
when
|
411
|
-
# line
|
694
|
+
when 44 then
|
695
|
+
# line 100 "lib/hotcell/lexer.rl"
|
412
696
|
begin
|
413
697
|
@te = @p
|
414
698
|
@p = @p - 1; begin emit_comment; end
|
415
699
|
end
|
416
|
-
when
|
417
|
-
# line
|
700
|
+
when 15 then
|
701
|
+
# line 95 "lib/hotcell/lexer.rl"
|
418
702
|
begin
|
419
703
|
begin @p = (( @te))-1; end
|
420
704
|
begin emit_operator; end
|
421
705
|
end
|
422
|
-
when
|
423
|
-
# line
|
706
|
+
when 10 then
|
707
|
+
# line 100 "lib/hotcell/lexer.rl"
|
424
708
|
begin
|
425
709
|
begin @p = (( @te))-1; end
|
426
710
|
begin emit_comment; end
|
427
711
|
end
|
428
|
-
when
|
712
|
+
when 14 then
|
429
713
|
# line 1 "NONE"
|
430
714
|
begin
|
431
715
|
case act
|
432
|
-
when
|
716
|
+
when 15 then
|
433
717
|
begin begin @p = (( @te))-1; end
|
434
718
|
emit_operator; end
|
435
|
-
when
|
719
|
+
when 16 then
|
436
720
|
begin begin @p = (( @te))-1; end
|
437
721
|
emit_numeric; end
|
438
722
|
end
|
439
723
|
end
|
440
|
-
when
|
441
|
-
# line
|
724
|
+
when 17 then
|
725
|
+
# line 105 "lib/hotcell/lexer.rl"
|
442
726
|
begin
|
443
727
|
@te = @p+1
|
444
728
|
begin emit_comment; begin
|
@@ -449,77 +733,77 @@ end
|
|
449
733
|
end
|
450
734
|
end
|
451
735
|
end
|
452
|
-
when
|
453
|
-
# line
|
736
|
+
when 50 then
|
737
|
+
# line 106 "lib/hotcell/lexer.rl"
|
454
738
|
begin
|
455
739
|
@te = @p
|
456
740
|
@p = @p - 1; begin emit_comment; end
|
457
741
|
end
|
458
|
-
when
|
459
|
-
# line
|
742
|
+
when 16 then
|
743
|
+
# line 106 "lib/hotcell/lexer.rl"
|
460
744
|
begin
|
461
745
|
begin @p = (( @te))-1; end
|
462
746
|
begin emit_comment; end
|
463
747
|
end
|
464
748
|
when 2 then
|
465
|
-
# line
|
749
|
+
# line 110 "lib/hotcell/lexer.rl"
|
466
750
|
begin
|
467
751
|
@te = @p+1
|
468
752
|
begin emit_tag; begin
|
469
753
|
stack[top] = cs
|
470
754
|
top+= 1
|
471
|
-
cs =
|
755
|
+
cs = 37
|
472
756
|
_goto_level = _again
|
473
757
|
next
|
474
758
|
end
|
475
759
|
end
|
476
760
|
end
|
477
|
-
when
|
478
|
-
# line
|
761
|
+
when 22 then
|
762
|
+
# line 111 "lib/hotcell/lexer.rl"
|
479
763
|
begin
|
480
764
|
@te = @p+1
|
481
765
|
begin emit_comment; begin
|
482
766
|
stack[top] = cs
|
483
767
|
top+= 1
|
484
|
-
cs =
|
768
|
+
cs = 50
|
485
769
|
_goto_level = _again
|
486
770
|
next
|
487
771
|
end
|
488
772
|
end
|
489
773
|
end
|
490
|
-
when
|
491
|
-
# line
|
774
|
+
when 21 then
|
775
|
+
# line 110 "lib/hotcell/lexer.rl"
|
492
776
|
begin
|
493
777
|
@te = @p
|
494
778
|
@p = @p - 1; begin emit_tag; begin
|
495
779
|
stack[top] = cs
|
496
780
|
top+= 1
|
497
|
-
cs =
|
781
|
+
cs = 37
|
498
782
|
_goto_level = _again
|
499
783
|
next
|
500
784
|
end
|
501
785
|
end
|
502
786
|
end
|
503
|
-
when
|
504
|
-
# line
|
787
|
+
when 20 then
|
788
|
+
# line 112 "lib/hotcell/lexer.rl"
|
505
789
|
begin
|
506
790
|
@te = @p
|
507
791
|
@p = @p - 1; begin emit_template; end
|
508
792
|
end
|
509
793
|
when 1 then
|
510
|
-
# line
|
794
|
+
# line 110 "lib/hotcell/lexer.rl"
|
511
795
|
begin
|
512
796
|
begin @p = (( @te))-1; end
|
513
797
|
begin emit_tag; begin
|
514
798
|
stack[top] = cs
|
515
799
|
top+= 1
|
516
|
-
cs =
|
800
|
+
cs = 37
|
517
801
|
_goto_level = _again
|
518
802
|
next
|
519
803
|
end
|
520
804
|
end
|
521
805
|
end
|
522
|
-
when
|
806
|
+
when 29 then
|
523
807
|
# line 1 "NONE"
|
524
808
|
begin
|
525
809
|
@te = @p+1
|
@@ -530,40 +814,72 @@ end
|
|
530
814
|
if (!regexp_possible)
|
531
815
|
emit_operator;
|
532
816
|
begin
|
533
|
-
cs =
|
817
|
+
cs = 37
|
534
818
|
_goto_level = _again
|
535
819
|
next
|
536
820
|
end
|
537
821
|
|
538
822
|
end
|
539
823
|
end
|
540
|
-
when
|
824
|
+
when 4 then
|
541
825
|
# line 1 "NONE"
|
542
826
|
begin
|
543
827
|
@te = @p+1
|
544
828
|
end
|
545
829
|
# line 75 "lib/hotcell/lexer.rl"
|
546
830
|
begin
|
547
|
-
act =
|
548
|
-
when
|
831
|
+
act = 3; end
|
832
|
+
when 28 then
|
549
833
|
# line 1 "NONE"
|
550
834
|
begin
|
551
835
|
@te = @p+1
|
552
836
|
end
|
553
|
-
# line
|
837
|
+
# line 81 "lib/hotcell/lexer.rl"
|
554
838
|
begin
|
555
|
-
act =
|
556
|
-
|
839
|
+
act = 4; end
|
840
|
+
when 30 then
|
841
|
+
# line 1 "NONE"
|
842
|
+
begin
|
843
|
+
@te = @p+1
|
844
|
+
end
|
845
|
+
# line 85 "lib/hotcell/lexer.rl"
|
846
|
+
begin
|
847
|
+
act = 8; end
|
848
|
+
when 40 then
|
849
|
+
# line 1 "NONE"
|
850
|
+
begin
|
851
|
+
@te = @p+1
|
852
|
+
end
|
853
|
+
# line 95 "lib/hotcell/lexer.rl"
|
854
|
+
begin
|
855
|
+
act = 15; end
|
856
|
+
when 41 then
|
857
|
+
# line 1 "NONE"
|
858
|
+
begin
|
859
|
+
@te = @p+1
|
860
|
+
end
|
861
|
+
# line 96 "lib/hotcell/lexer.rl"
|
862
|
+
begin
|
863
|
+
act = 16; end
|
864
|
+
# line 865 "lib/hotcell/lexerr.rb"
|
557
865
|
end
|
558
866
|
end
|
559
867
|
end
|
560
868
|
if _goto_level <= _again
|
561
|
-
case
|
562
|
-
when
|
869
|
+
case _hotcell_lexer_to_state_actions[cs]
|
870
|
+
when 18 then
|
871
|
+
# line 1 "NONE"
|
872
|
+
begin
|
873
|
+
@ts = nil; end
|
874
|
+
when 23 then
|
563
875
|
# line 1 "NONE"
|
564
876
|
begin
|
565
877
|
@ts = nil; end
|
566
|
-
# line
|
878
|
+
# line 1 "NONE"
|
879
|
+
begin
|
880
|
+
act = 0
|
881
|
+
end
|
882
|
+
# line 883 "lib/hotcell/lexerr.rb"
|
567
883
|
end
|
568
884
|
|
569
885
|
if cs == 0
|
@@ -578,21 +894,17 @@ act = 3; end
|
|
578
894
|
end
|
579
895
|
if _goto_level <= _test_eof
|
580
896
|
if @p == eof
|
581
|
-
if
|
582
|
-
_trans =
|
897
|
+
if _hotcell_lexer_eof_trans[cs] > 0
|
898
|
+
_trans = _hotcell_lexer_eof_trans[cs] - 1;
|
583
899
|
_goto_level = _eof_trans
|
584
900
|
next;
|
585
901
|
end
|
586
|
-
case
|
587
|
-
when
|
902
|
+
case _hotcell_lexer_eof_actions[cs]
|
903
|
+
when 6 then
|
588
904
|
# line 46 "lib/hotcell/lexer.rl"
|
589
905
|
begin
|
590
906
|
raise_unterminated_string; end
|
591
|
-
|
592
|
-
# line 50 "lib/hotcell/lexer.rl"
|
593
|
-
begin
|
594
|
-
raise_unterminated_string; end
|
595
|
-
# line 596 "lib/hotcell/lexerr.rb"
|
907
|
+
# line 908 "lib/hotcell/lexerr.rb"
|
596
908
|
end
|
597
909
|
end
|
598
910
|
|
@@ -603,11 +915,16 @@ act = 3; end
|
|
603
915
|
end
|
604
916
|
end
|
605
917
|
|
606
|
-
# line
|
918
|
+
# line 74 "lib/hotcell/lexerr.rl"
|
607
919
|
#%
|
608
920
|
|
609
921
|
raise_unexpected_symbol unless @ts.nil?
|
610
922
|
|
923
|
+
if cs == hotcell_lexer_en_dstring
|
924
|
+
@ts = @dstring_start
|
925
|
+
raise_unterminated_string
|
926
|
+
end
|
927
|
+
|
611
928
|
@token_array
|
612
929
|
end
|
613
930
|
end
|