raf-parser 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/History.rdoc +6 -1
- data/RELEASE +1 -1
- data/VERSION +1 -1
- data/lib/rafblockparser.ry +4 -0
- data/lib/rafblockparser.tab.rb +4 -0
- data/lib/rafelement.rb +12 -0
- data/lib/rafinlineparser.ry +44 -41
- data/lib/rafinlineparser.tab.rb +346 -333
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af19c289cec306caf69312d8d9668dafb7428062
|
4
|
+
data.tar.gz: 0218da92ad12232d0ad41c47c1e24043584e1aa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2554fe485f33bbf278a79ecd82058938a13d1567f07935b7a90631328062a4987436d0e89090bef08c190bd95cf724c776c3507ba83fdf04472c84ebbdb7c91d
|
7
|
+
data.tar.gz: 0330b7bad7273f058ac7ce6a4219632adbcd30a7e4a39c412836e36e143014f7dc463a0b924e40c777c4a4d0b1397e24a8d72b2bd8a0f0a399232b2c0d452d20
|
data/History.rdoc
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
+
== 0.2.1 2013-12-04
|
2
|
+
* kbd書式 ((%...%)) を追加
|
3
|
+
* code書式 (({...})) を追加
|
4
|
+
* ERBの処理をraccでパースする前に移動
|
5
|
+
|
1
6
|
== 0.2.0 2013-12-01
|
2
7
|
* プロジェクト名を raf から raf-parser に変更
|
3
|
-
* raf2html 関連のファイルを raf2html プロジェクトに移動
|
8
|
+
* raf2html 関連のファイルを raf2html プロジェクトに移動
|
4
9
|
|
5
10
|
== 0.1.0 2013-11-26
|
6
11
|
* Ruby-2.0.0 をサポート
|
data/RELEASE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2013-12-
|
1
|
+
2013-12-04
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/rafblockparser.ry
CHANGED
@@ -149,6 +149,9 @@ attr_reader :metadata, :inline_index, :index
|
|
149
149
|
|
150
150
|
def parse(src)
|
151
151
|
@no = 0
|
152
|
+
# srcをerbで処理
|
153
|
+
src = ERB.new(src.join).result(binding).split("\n").map {|s| "#{s}\n"}
|
154
|
+
|
152
155
|
@src = Array(src)
|
153
156
|
@line = Line.new("")
|
154
157
|
@line_pre = @line.dup
|
@@ -335,6 +338,7 @@ end
|
|
335
338
|
require "parserutility"
|
336
339
|
require "rafinlineparser.tab"
|
337
340
|
require "rafelement"
|
341
|
+
require "erb"
|
338
342
|
|
339
343
|
module Raf
|
340
344
|
|
data/lib/rafblockparser.tab.rb
CHANGED
@@ -9,6 +9,7 @@ require 'racc/parser.rb'
|
|
9
9
|
require "parserutility"
|
10
10
|
require "rafinlineparser.tab"
|
11
11
|
require "rafelement"
|
12
|
+
require "erb"
|
12
13
|
|
13
14
|
module Raf
|
14
15
|
|
@@ -47,6 +48,9 @@ attr_reader :metadata, :inline_index, :index
|
|
47
48
|
|
48
49
|
def parse(src)
|
49
50
|
@no = 0
|
51
|
+
# srcをerbで処理
|
52
|
+
src = ERB.new(src.join).result(binding).split("\n").map {|s| "#{s}\n"}
|
53
|
+
|
50
54
|
@src = Array(src)
|
51
55
|
@line = Line.new("")
|
52
56
|
@line_pre = @line.dup
|
data/lib/rafelement.rb
CHANGED
@@ -182,6 +182,18 @@ module Raf
|
|
182
182
|
end
|
183
183
|
end
|
184
184
|
|
185
|
+
class Code < Element
|
186
|
+
def apply
|
187
|
+
"<Code>#{@contents.map{|c| c.apply}}</Code>"
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
class Kbd < Element
|
192
|
+
def apply
|
193
|
+
"<Kbd>#{@contents.map{|c| c.apply}}</Kbd>"
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
185
197
|
class Ruby < Element
|
186
198
|
def apply
|
187
199
|
"<Ruby>Base:#{@contents[0]},Text:#{@contents[1]}</Ruby>"
|
data/lib/rafinlineparser.ry
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (C) garin <garin54@gmail.com> 2011
|
2
2
|
# See the included file COPYING for details.
|
3
3
|
class InlineParser
|
4
|
-
token EM_OPEN EM_CLOSE ITALIC_OPEN ITALIC_CLOSE STRIKE_OPEN STRIKE_CLOSE LABEL_OPEN LABEL_CLOSE REFERENCE_OPEN REFERENCE_CLOSE VERB_OPEN VERB_CLOSE
|
4
|
+
token EM_OPEN EM_CLOSE ITALIC_OPEN ITALIC_CLOSE STRIKE_OPEN STRIKE_CLOSE CODE_OPEN CODE_CLOSE KBD_OPEN KBD_CLOSE LABEL_OPEN LABEL_CLOSE REFERENCE_OPEN REFERENCE_CLOSE VERB_OPEN VERB_CLOSE FOOTNOTE_OPEN FOOTNOTE_CLOSE RUBY_OPEN RUBY_CLOSE IMAGE_OPEN IMAGE_CLOSE MANUEDO_OPEN MANUEDO_CLOSE OTHER
|
5
5
|
options no_result_var
|
6
6
|
rule
|
7
7
|
content :
|
@@ -13,14 +13,14 @@ class InlineParser
|
|
13
13
|
element : emphasis
|
14
14
|
| italic
|
15
15
|
| strike
|
16
|
+
| code
|
17
|
+
| kbd
|
16
18
|
| label
|
17
19
|
| reference
|
18
20
|
| ruby
|
19
21
|
| footnote
|
20
22
|
| image
|
21
23
|
| verb
|
22
|
-
| erb
|
23
|
-
| herb
|
24
24
|
| manuedo
|
25
25
|
| normal_strings
|
26
26
|
|
@@ -28,6 +28,8 @@ class InlineParser
|
|
28
28
|
emphasis : EM_OPEN content EM_CLOSE { Emphasis.new(val[1]) }
|
29
29
|
italic : ITALIC_OPEN content ITALIC_CLOSE { Italic.new(val[1]) }
|
30
30
|
strike : STRIKE_OPEN content STRIKE_CLOSE { Strike.new(val[1]) }
|
31
|
+
code : CODE_OPEN content CODE_CLOSE { Code.new(val[1]) }
|
32
|
+
kbd : KBD_OPEN content KBD_CLOSE { Kbd.new(val[1]) }
|
31
33
|
footnote : FOOTNOTE_OPEN content FOOTNOTE_CLOSE {
|
32
34
|
@index[:footnote] ||= []
|
33
35
|
@index[:footnote] << {:content => val[1] }
|
@@ -44,13 +46,14 @@ class InlineParser
|
|
44
46
|
| ITALIC_CLOSE
|
45
47
|
| STRIKE_OPEN
|
46
48
|
| STRIKE_CLOSE
|
49
|
+
| CODE_OPEN
|
50
|
+
| CODE_CLOSE
|
51
|
+
| KBD_OPEN
|
52
|
+
| KBD_CLOSE
|
47
53
|
| RUBY_OPEN
|
48
54
|
| RUBY_CLOSE
|
49
55
|
| MANUEDO_OPEN
|
50
56
|
| MANUEDO_CLOSE
|
51
|
-
| ERB_OPEN
|
52
|
-
| ERB_CLOSE
|
53
|
-
| HERB_OPEN
|
54
57
|
| REFERENCE_OPEN
|
55
58
|
| REFERENCE_CLOSE
|
56
59
|
| LABEL_OPEN
|
@@ -74,13 +77,14 @@ class InlineParser
|
|
74
77
|
| ITALIC_CLOSE
|
75
78
|
| STRIKE_OPEN
|
76
79
|
| STRIKE_CLOSE
|
80
|
+
| CODE_OPEN
|
81
|
+
| CODE_CLOSE
|
82
|
+
| KBD_OPEN
|
83
|
+
| KBD_CLOSE
|
77
84
|
| IMAGE_OPEN
|
78
85
|
| IMAGE_CLOSE
|
79
86
|
| MANUEDO_OPEN
|
80
87
|
| MANUEDO_CLOSE
|
81
|
-
| ERB_OPEN
|
82
|
-
| ERB_CLOSE
|
83
|
-
| HERB_OPEN
|
84
88
|
| REFERENCE_OPEN
|
85
89
|
| REFERENCE_CLOSE
|
86
90
|
| LABEL_OPEN
|
@@ -101,14 +105,6 @@ class InlineParser
|
|
101
105
|
}
|
102
106
|
|
103
107
|
# --- ruby end
|
104
|
-
# --- erb
|
105
|
-
erb : ERB_OPEN verb_string ERB_CLOSE {
|
106
|
-
e = ERB.new("<%= #{val[1]} %>")
|
107
|
-
Plain.new(e.result) }
|
108
|
-
herb : HERB_OPEN verb_string ERB_CLOSE {
|
109
|
-
e = ERB.new("<% #{val[1]} %>")
|
110
|
-
Plain.new(e.result) }
|
111
|
-
# --- erb end
|
112
108
|
# --- manuedo
|
113
109
|
manuedo : MANUEDO_OPEN content MANUEDO_CLOSE { Manuedo.new(val[1]) }
|
114
110
|
|
@@ -151,13 +147,14 @@ class InlineParser
|
|
151
147
|
| ITALIC_CLOSE
|
152
148
|
| STRIKE_OPEN
|
153
149
|
| STRIKE_CLOSE
|
150
|
+
| CODE_OPEN
|
151
|
+
| CODE_CLOSE
|
152
|
+
| KBD_OPEN
|
153
|
+
| KBD_CLOSE
|
154
154
|
| IMAGE_OPEN
|
155
155
|
| IMAGE_CLOSE
|
156
156
|
| MANUEDO_OPEN
|
157
157
|
| MANUEDO_CLOSE
|
158
|
-
| ERB_OPEN
|
159
|
-
| ERB_CLOSE
|
160
|
-
| HERB_OPEN
|
161
158
|
| REFERENCE_OPEN
|
162
159
|
| REFERENCE_CLOSE
|
163
160
|
| LABEL_OPEN
|
@@ -199,6 +196,16 @@ STRIKE_OPEN_RE = /\A#{Regexp.quote(STRIKE_OPEN)}/
|
|
199
196
|
STRIKE_CLOSE = '-))'
|
200
197
|
STRIKE_CLOSE_RE = /\A#{Regexp.quote(STRIKE_CLOSE)}/
|
201
198
|
|
199
|
+
CODE_OPEN = '(({'
|
200
|
+
CODE_OPEN_RE = /\A#{Regexp.quote(CODE_OPEN)}/
|
201
|
+
CODE_CLOSE = '}))'
|
202
|
+
CODE_CLOSE_RE = /\A#{Regexp.quote(CODE_CLOSE)}/
|
203
|
+
|
204
|
+
KBD_OPEN = '((%'
|
205
|
+
KBD_OPEN_RE = /\A#{Regexp.quote(KBD_OPEN)}/
|
206
|
+
KBD_CLOSE = '%))'
|
207
|
+
KBD_CLOSE_RE = /\A#{Regexp.quote(KBD_CLOSE)}/
|
208
|
+
|
202
209
|
RUBY_OPEN = '((^'
|
203
210
|
RUBY_OPEN_RE = /\A#{Regexp.quote(RUBY_OPEN)}/
|
204
211
|
RUBY_CLOSE = '^))'
|
@@ -244,21 +251,13 @@ MANUEDO_OPEN_RE = /\A#{Regexp.quote(MANUEDO_OPEN)}/
|
|
244
251
|
MANUEDO_CLOSE = "/))"
|
245
252
|
MANUEDO_CLOSE_RE = /\A#{Regexp.quote(MANUEDO_CLOSE)}/
|
246
253
|
|
247
|
-
ERB_OPEN = "<%="
|
248
|
-
ERB_OPEN_RE = /\A#{Regexp.quote(ERB_OPEN)}/
|
249
|
-
ERB_CLOSE = "%>"
|
250
|
-
ERB_CLOSE_RE = /\A#{Regexp.quote(ERB_CLOSE)}/
|
251
|
-
|
252
|
-
HERB_OPEN = "<%"
|
253
|
-
HERB_OPEN_RE = /\A#{Regexp.quote(HERB_OPEN)}/
|
254
|
-
|
255
254
|
# URL = "URL:"
|
256
255
|
# URL_RE = /\A#{Regexp.quote(URL)}/
|
257
256
|
|
258
257
|
#other_re_mode = Regexp::EXTENDED
|
259
258
|
other_re_mode = Regexp::MULTILINE
|
260
259
|
OTHER_RE = Regexp.new(
|
261
|
-
"\\A.+?(?=#{Regexp.quote(EM_OPEN)}|#{Regexp.quote(EM_CLOSE)}|#{Regexp.quote(ITALIC_OPEN)}|#{Regexp.quote(ITALIC_CLOSE)}|#{Regexp.quote(STRIKE_OPEN)}|#{Regexp.quote(STRIKE_CLOSE)}|#{Regexp.quote(
|
260
|
+
"\\A.+?(?=#{Regexp.quote(EM_OPEN)}|#{Regexp.quote(EM_CLOSE)}|#{Regexp.quote(ITALIC_OPEN)}|#{Regexp.quote(ITALIC_CLOSE)}|#{Regexp.quote(STRIKE_OPEN)}|#{Regexp.quote(STRIKE_CLOSE)}|#{Regexp.quote(CODE_OPEN)}|#{Regexp.quote(CODE_CLOSE)}|#{Regexp.quote(KBD_OPEN)}|#{Regexp.quote(KBD_CLOSE)}|#{Regexp.quote(FOOTNOTE_OPEN)}|#{Regexp.quote(FOOTNOTE_CLOSE)}|#{Regexp.quote(RUBY_OPEN)}|#{Regexp.quote(RUBY_CLOSE)}|#{Regexp.quote(IMAGE_OPEN)}|#{Regexp.quote(IMAGE_CLOSE)}|#{Regexp.quote(LABEL_OPEN)}|#{Regexp.quote(LABEL_CLOSE)}|#{Regexp.quote(LABEL_HTML_OPEN)}|#{Regexp.quote(LABEL_HTML_CLOSE)}|#{Regexp.quote(REFERENCE_OPEN)}|#{Regexp.quote(REFERENCE_CLOSE)}|#{Regexp.quote(REFERENCE_HTML_OPEN)}|#{Regexp.quote(REFERENCE_HTML_CLOSE)}|#{Regexp.quote(MANUEDO_OPEN)}|#{Regexp.quote(MANUEDO_CLOSE)}|#{Regexp.quote(VERB_OPEN)}|#{Regexp.quote(VERB_CLOSE)})", other_re_mode)
|
262
261
|
|
263
262
|
def parse(src)
|
264
263
|
@src = StringScanner.new(Array(src).join)
|
@@ -298,6 +297,22 @@ def next_token
|
|
298
297
|
@pre << ret
|
299
298
|
puts "i: STRIKE_CLOSE: #{ret}" if @view_token_type
|
300
299
|
[:STRIKE_CLOSE, ret]
|
300
|
+
elsif ret = @src.scan(CODE_OPEN_RE)
|
301
|
+
@pre << ret
|
302
|
+
puts "i: CODE_OPEN: #{ret}" if @view_token_type
|
303
|
+
[:CODE_OPEN, ret]
|
304
|
+
elsif ret = @src.scan(CODE_CLOSE_RE)
|
305
|
+
@pre << ret
|
306
|
+
puts "i: CODE_CLOSE: #{ret}" if @view_token_type
|
307
|
+
[:CODE_CLOSE, ret]
|
308
|
+
elsif ret = @src.scan(KBD_OPEN_RE)
|
309
|
+
@pre << ret
|
310
|
+
puts "i: KBD_OPEN: #{ret}" if @view_token_type
|
311
|
+
[:KBD_OPEN, ret]
|
312
|
+
elsif ret = @src.scan(KBD_CLOSE_RE)
|
313
|
+
@pre << ret
|
314
|
+
puts "i: KBD_CLOSE: #{ret}" if @view_token_type
|
315
|
+
[:KBD_CLOSE, ret]
|
301
316
|
elsif ret = @src.scan(LABEL_OPEN_RE)
|
302
317
|
@pre << ret
|
303
318
|
puts "i: LABEL_OPEN: #{ret}" if @view_token_type
|
@@ -370,18 +385,6 @@ def next_token
|
|
370
385
|
puts "i: MANUED_CLOSE: #{ret}" if @view_token_type
|
371
386
|
@pre << ret
|
372
387
|
[:MANUEDO_CLOSE, ret]
|
373
|
-
elsif ret = @src.scan(ERB_OPEN_RE)
|
374
|
-
puts "i: ERB_OPEN: #{ret}" if @view_token_type
|
375
|
-
@pre << ret
|
376
|
-
[:ERB_OPEN, ret]
|
377
|
-
elsif ret = @src.scan(ERB_CLOSE_RE)
|
378
|
-
puts "i: ERB_CLOSE: #{ret}" if @view_token_type
|
379
|
-
@pre << ret
|
380
|
-
[:ERB_CLOSE, ret]
|
381
|
-
elsif ret = @src.scan(HERB_OPEN_RE)
|
382
|
-
puts "i: HERB_OPEN: #{ret}" if @view_token_type
|
383
|
-
@pre << ret
|
384
|
-
[:HERB_OPEN, ret]
|
385
388
|
elsif ret = @src.scan(OTHER_RE)
|
386
389
|
puts "i: OTHER_RE: #{ret}" if @view_token_type
|
387
390
|
@pre << ret
|
data/lib/rafinlineparser.tab.rb
CHANGED
@@ -14,7 +14,7 @@ require 'rafelement'
|
|
14
14
|
module Raf
|
15
15
|
class InlineParser < Racc::Parser
|
16
16
|
|
17
|
-
module_eval(<<'...end rafinlineparser.ry/module_eval...', 'rafinlineparser.ry',
|
17
|
+
module_eval(<<'...end rafinlineparser.ry/module_eval...', 'rafinlineparser.ry', 182)
|
18
18
|
include ParserUtility
|
19
19
|
|
20
20
|
EM_OPEN = '((*'
|
@@ -32,6 +32,16 @@ STRIKE_OPEN_RE = /\A#{Regexp.quote(STRIKE_OPEN)}/
|
|
32
32
|
STRIKE_CLOSE = '-))'
|
33
33
|
STRIKE_CLOSE_RE = /\A#{Regexp.quote(STRIKE_CLOSE)}/
|
34
34
|
|
35
|
+
CODE_OPEN = '(({'
|
36
|
+
CODE_OPEN_RE = /\A#{Regexp.quote(CODE_OPEN)}/
|
37
|
+
CODE_CLOSE = '}))'
|
38
|
+
CODE_CLOSE_RE = /\A#{Regexp.quote(CODE_CLOSE)}/
|
39
|
+
|
40
|
+
KBD_OPEN = '((%'
|
41
|
+
KBD_OPEN_RE = /\A#{Regexp.quote(KBD_OPEN)}/
|
42
|
+
KBD_CLOSE = '%))'
|
43
|
+
KBD_CLOSE_RE = /\A#{Regexp.quote(KBD_CLOSE)}/
|
44
|
+
|
35
45
|
RUBY_OPEN = '((^'
|
36
46
|
RUBY_OPEN_RE = /\A#{Regexp.quote(RUBY_OPEN)}/
|
37
47
|
RUBY_CLOSE = '^))'
|
@@ -77,21 +87,13 @@ MANUEDO_OPEN_RE = /\A#{Regexp.quote(MANUEDO_OPEN)}/
|
|
77
87
|
MANUEDO_CLOSE = "/))"
|
78
88
|
MANUEDO_CLOSE_RE = /\A#{Regexp.quote(MANUEDO_CLOSE)}/
|
79
89
|
|
80
|
-
ERB_OPEN = "<%="
|
81
|
-
ERB_OPEN_RE = /\A#{Regexp.quote(ERB_OPEN)}/
|
82
|
-
ERB_CLOSE = "%>"
|
83
|
-
ERB_CLOSE_RE = /\A#{Regexp.quote(ERB_CLOSE)}/
|
84
|
-
|
85
|
-
HERB_OPEN = "<%"
|
86
|
-
HERB_OPEN_RE = /\A#{Regexp.quote(HERB_OPEN)}/
|
87
|
-
|
88
90
|
# URL = "URL:"
|
89
91
|
# URL_RE = /\A#{Regexp.quote(URL)}/
|
90
92
|
|
91
93
|
#other_re_mode = Regexp::EXTENDED
|
92
94
|
other_re_mode = Regexp::MULTILINE
|
93
95
|
OTHER_RE = Regexp.new(
|
94
|
-
"\\A.+?(?=#{Regexp.quote(EM_OPEN)}|#{Regexp.quote(EM_CLOSE)}|#{Regexp.quote(ITALIC_OPEN)}|#{Regexp.quote(ITALIC_CLOSE)}|#{Regexp.quote(STRIKE_OPEN)}|#{Regexp.quote(STRIKE_CLOSE)}|#{Regexp.quote(
|
96
|
+
"\\A.+?(?=#{Regexp.quote(EM_OPEN)}|#{Regexp.quote(EM_CLOSE)}|#{Regexp.quote(ITALIC_OPEN)}|#{Regexp.quote(ITALIC_CLOSE)}|#{Regexp.quote(STRIKE_OPEN)}|#{Regexp.quote(STRIKE_CLOSE)}|#{Regexp.quote(CODE_OPEN)}|#{Regexp.quote(CODE_CLOSE)}|#{Regexp.quote(KBD_OPEN)}|#{Regexp.quote(KBD_CLOSE)}|#{Regexp.quote(FOOTNOTE_OPEN)}|#{Regexp.quote(FOOTNOTE_CLOSE)}|#{Regexp.quote(RUBY_OPEN)}|#{Regexp.quote(RUBY_CLOSE)}|#{Regexp.quote(IMAGE_OPEN)}|#{Regexp.quote(IMAGE_CLOSE)}|#{Regexp.quote(LABEL_OPEN)}|#{Regexp.quote(LABEL_CLOSE)}|#{Regexp.quote(LABEL_HTML_OPEN)}|#{Regexp.quote(LABEL_HTML_CLOSE)}|#{Regexp.quote(REFERENCE_OPEN)}|#{Regexp.quote(REFERENCE_CLOSE)}|#{Regexp.quote(REFERENCE_HTML_OPEN)}|#{Regexp.quote(REFERENCE_HTML_CLOSE)}|#{Regexp.quote(MANUEDO_OPEN)}|#{Regexp.quote(MANUEDO_CLOSE)}|#{Regexp.quote(VERB_OPEN)}|#{Regexp.quote(VERB_CLOSE)})", other_re_mode)
|
95
97
|
|
96
98
|
def parse(src)
|
97
99
|
@src = StringScanner.new(Array(src).join)
|
@@ -131,6 +133,22 @@ def next_token
|
|
131
133
|
@pre << ret
|
132
134
|
puts "i: STRIKE_CLOSE: #{ret}" if @view_token_type
|
133
135
|
[:STRIKE_CLOSE, ret]
|
136
|
+
elsif ret = @src.scan(CODE_OPEN_RE)
|
137
|
+
@pre << ret
|
138
|
+
puts "i: CODE_OPEN: #{ret}" if @view_token_type
|
139
|
+
[:CODE_OPEN, ret]
|
140
|
+
elsif ret = @src.scan(CODE_CLOSE_RE)
|
141
|
+
@pre << ret
|
142
|
+
puts "i: CODE_CLOSE: #{ret}" if @view_token_type
|
143
|
+
[:CODE_CLOSE, ret]
|
144
|
+
elsif ret = @src.scan(KBD_OPEN_RE)
|
145
|
+
@pre << ret
|
146
|
+
puts "i: KBD_OPEN: #{ret}" if @view_token_type
|
147
|
+
[:KBD_OPEN, ret]
|
148
|
+
elsif ret = @src.scan(KBD_CLOSE_RE)
|
149
|
+
@pre << ret
|
150
|
+
puts "i: KBD_CLOSE: #{ret}" if @view_token_type
|
151
|
+
[:KBD_CLOSE, ret]
|
134
152
|
elsif ret = @src.scan(LABEL_OPEN_RE)
|
135
153
|
@pre << ret
|
136
154
|
puts "i: LABEL_OPEN: #{ret}" if @view_token_type
|
@@ -203,18 +221,6 @@ def next_token
|
|
203
221
|
puts "i: MANUED_CLOSE: #{ret}" if @view_token_type
|
204
222
|
@pre << ret
|
205
223
|
[:MANUEDO_CLOSE, ret]
|
206
|
-
elsif ret = @src.scan(ERB_OPEN_RE)
|
207
|
-
puts "i: ERB_OPEN: #{ret}" if @view_token_type
|
208
|
-
@pre << ret
|
209
|
-
[:ERB_OPEN, ret]
|
210
|
-
elsif ret = @src.scan(ERB_CLOSE_RE)
|
211
|
-
puts "i: ERB_CLOSE: #{ret}" if @view_token_type
|
212
|
-
@pre << ret
|
213
|
-
[:ERB_CLOSE, ret]
|
214
|
-
elsif ret = @src.scan(HERB_OPEN_RE)
|
215
|
-
puts "i: HERB_OPEN: #{ret}" if @view_token_type
|
216
|
-
@pre << ret
|
217
|
-
[:HERB_OPEN, ret]
|
218
224
|
elsif ret = @src.scan(OTHER_RE)
|
219
225
|
puts "i: OTHER_RE: #{ret}" if @view_token_type
|
220
226
|
@pre << ret
|
@@ -232,137 +238,135 @@ end
|
|
232
238
|
##### State transition tables begin ###
|
233
239
|
|
234
240
|
racc_action_table = [
|
235
|
-
17,
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
nil,
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
103, 104, 111, 139, 100, 101, 102, 109, 110, 107,
|
268
|
-
108, 96, 97, 98, 99, 89 ]
|
241
|
+
17, 131, 18, 127, 19, 128, 20, 129, 21, 130,
|
242
|
+
26, 126, 27, 30, 28, 31, 22, 136, 24, 93,
|
243
|
+
23, 125, 25, 96, 30, 67, 68, 69, 70, 71,
|
244
|
+
72, 73, 74, 75, 76, 83, 84, 81, 82, 88,
|
245
|
+
89, 86, 87, 85, 135, 77, 78, 79, 80, 66,
|
246
|
+
17, nil, 18, nil, 19, nil, 20, nil, 21, nil,
|
247
|
+
26, nil, 27, nil, 28, nil, 22, nil, 24, nil,
|
248
|
+
23, nil, 25, nil, 30, 41, 42, 43, 44, 45,
|
249
|
+
46, 47, 48, 49, 50, 57, 58, 55, 56, 61,
|
250
|
+
62, 59, 60, 51, 52, 63, 133, 53, 54, 40,
|
251
|
+
17, 17, 18, 18, 19, 19, 20, 20, 21, 21,
|
252
|
+
26, 26, 27, 27, 28, 28, 22, 22, 24, 24,
|
253
|
+
23, 23, 25, 25, 30, 30, 17, 17, 18, 18,
|
254
|
+
19, 19, 20, 20, 21, 21, 26, 26, 27, 27,
|
255
|
+
28, 28, 22, 22, 24, 24, 23, 23, 25, 25,
|
256
|
+
30, 30, 17, 17, 18, 18, 19, 19, 20, 20,
|
257
|
+
21, 21, 26, 26, 27, 27, 28, 28, 22, 22,
|
258
|
+
24, 24, 23, 23, 25, 25, 30, 30, 41, 42,
|
259
|
+
43, 44, 45, 46, 47, 48, 49, 50, 57, 58,
|
260
|
+
55, 56, 61, 62, 59, 60, 51, 52, 63, nil,
|
261
|
+
53, 54, 40, 67, 68, 69, 70, 71, 72, 73,
|
262
|
+
74, 75, 76, 83, 84, 81, 82, 88, 89, 86,
|
263
|
+
87, 85, 138, 77, 78, 79, 80, 66, 17, nil,
|
264
|
+
18, nil, 19, nil, 20, 93, 21, nil, 26, nil,
|
265
|
+
27, nil, 28, nil, 22, nil, 24, nil, 23, nil,
|
266
|
+
25, nil, 30, 100, 101, 102, 103, 104, 105, 106,
|
267
|
+
107, 108, 109, 116, 117, 114, 115, 122, nil, 120,
|
268
|
+
121, 118, 119, 110, 111, 112, 113, 99, 100, 101,
|
269
|
+
102, 103, 104, 105, 106, 107, 108, 109, 116, 117,
|
270
|
+
114, 115, 122, 142, 120, 121, 118, 119, 110, 111,
|
271
|
+
112, 113, 99, 140, nil, nil, nil, nil, nil, nil,
|
272
|
+
nil, nil, nil, nil, 96 ]
|
269
273
|
|
270
274
|
racc_action_check = [
|
271
|
-
0,
|
272
|
-
0, 34, 0,
|
273
|
-
|
274
|
-
|
275
|
-
|
275
|
+
0, 39, 0, 35, 0, 36, 0, 37, 0, 38,
|
276
|
+
0, 34, 0, 16, 0, 1, 0, 92, 0, 26,
|
277
|
+
0, 31, 0, 27, 0, 90, 90, 90, 90, 90,
|
278
|
+
90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
|
279
|
+
90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
|
276
280
|
2, nil, 2, nil, 2, nil, 2, nil, 2, nil,
|
277
|
-
2, nil, 2, 2, nil, 2, nil, 2, nil,
|
278
|
-
nil, 2,
|
279
|
-
|
280
|
-
|
281
|
-
17,
|
282
|
-
17, 17, 18, 17, 18, 17, 18, 17, 18,
|
283
|
-
|
284
|
-
19,
|
285
|
-
19,
|
286
|
-
|
287
|
-
|
288
|
-
21,
|
289
|
-
21, 21, 21, 21, 21, 21, 21, 21, nil, 21,
|
290
|
-
21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
|
291
|
-
22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
|
292
|
-
nil, 22, 22, 22, 22, 22, 23, 23, 23, 23,
|
293
|
-
23, 23, 23, 23, 23, 23, 23, nil, 23, 23,
|
281
|
+
2, nil, 2, nil, 2, nil, 2, nil, 2, nil,
|
282
|
+
2, nil, 2, nil, 2, 64, 64, 64, 64, 64,
|
283
|
+
64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
284
|
+
64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
285
|
+
17, 18, 17, 18, 17, 18, 17, 18, 17, 18,
|
286
|
+
17, 18, 17, 18, 17, 18, 17, 18, 17, 18,
|
287
|
+
17, 18, 17, 18, 17, 18, 19, 20, 19, 20,
|
288
|
+
19, 20, 19, 20, 19, 20, 19, 20, 19, 20,
|
289
|
+
19, 20, 19, 20, 19, 20, 19, 20, 19, 20,
|
290
|
+
19, 20, 21, 22, 21, 22, 21, 22, 21, 22,
|
291
|
+
21, 22, 21, 22, 21, 22, 21, 22, 21, 22,
|
292
|
+
21, 22, 21, 22, 21, 22, 21, 22, 23, 23,
|
294
293
|
23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
|
294
|
+
23, 23, 23, 23, 23, 23, 23, 23, 23, nil,
|
295
|
+
23, 23, 23, 24, 24, 24, 24, 24, 24, 24,
|
295
296
|
24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
296
|
-
24,
|
297
|
-
|
298
|
-
25, nil, 25, nil, 25, nil, 25, nil, 25,
|
299
|
-
|
300
|
-
28, 28, 28, 28, 28, 28, 28, 28, 28,
|
301
|
-
28, 28, 28, 28, 28, 28, 28, 28,
|
302
|
-
|
303
|
-
|
304
|
-
|
297
|
+
24, 24, 94, 24, 24, 24, 24, 24, 25, nil,
|
298
|
+
25, nil, 25, nil, 25, 94, 25, nil, 25, nil,
|
299
|
+
25, nil, 25, nil, 25, nil, 25, nil, 25, nil,
|
300
|
+
25, nil, 25, 28, 28, 28, 28, 28, 28, 28,
|
301
|
+
28, 28, 28, 28, 28, 28, 28, 28, nil, 28,
|
302
|
+
28, 28, 28, 28, 28, 28, 28, 28, 124, 124,
|
303
|
+
124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
|
304
|
+
124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
|
305
|
+
124, 124, 124, 97, nil, nil, nil, nil, nil, nil,
|
306
|
+
nil, nil, nil, nil, 97 ]
|
305
307
|
|
306
308
|
racc_action_pointer = [
|
307
|
-
-2,
|
308
|
-
nil, nil, nil, nil, nil, nil, -
|
309
|
-
|
310
|
-
nil,
|
309
|
+
-2, 15, 48, nil, nil, nil, nil, nil, nil, nil,
|
310
|
+
nil, nil, nil, nil, nil, nil, -13, 98, 99, 124,
|
311
|
+
125, 150, 151, 176, 201, 226, -7, -3, 251, nil,
|
312
|
+
nil, 21, nil, nil, 8, -2, -2, -2, -2, -18,
|
313
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
314
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
315
|
+
nil, nil, nil, nil, 73, nil, nil, nil, nil, nil,
|
311
316
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
312
317
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
313
|
-
nil,
|
318
|
+
23, nil, -8, nil, 209, nil, nil, 288, nil, nil,
|
314
319
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
315
|
-
nil, nil, nil, nil, nil, nil, 22, nil, -2, nil,
|
316
320
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
321
|
+
nil, nil, nil, nil, 276, nil, nil, nil, nil, nil,
|
317
322
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
318
|
-
nil, nil,
|
319
|
-
nil, 310, nil, nil, nil, nil, nil, nil, nil, nil,
|
320
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ]
|
323
|
+
nil, nil, nil ]
|
321
324
|
|
322
325
|
racc_action_default = [
|
323
|
-
-1, -
|
326
|
+
-1, -117, -2, -4, -5, -6, -7, -8, -9, -10,
|
324
327
|
-11, -12, -13, -14, -15, -16, -17, -1, -1, -1,
|
325
|
-
-1,
|
326
|
-
-
|
328
|
+
-1, -1, -1, -117, -117, -1, -117, -117, -117, -114,
|
329
|
+
-116, -117, -3, -115, -117, -117, -117, -117, -117, -117,
|
327
330
|
-24, -25, -26, -27, -28, -29, -30, -31, -32, -33,
|
328
331
|
-34, -35, -36, -37, -38, -39, -40, -41, -42, -43,
|
329
|
-
-44,
|
332
|
+
-44, -45, -46, -47, -117, -49, -51, -52, -53, -54,
|
330
333
|
-55, -56, -57, -58, -59, -60, -61, -62, -63, -64,
|
331
|
-
-65, -66, -67, -68, -69, -70,
|
332
|
-
|
333
|
-
-
|
334
|
-
|
335
|
-
-108, -
|
336
|
-
-
|
334
|
+
-65, -66, -67, -68, -69, -70, -71, -72, -73, -74,
|
335
|
+
-117, -76, -117, -79, -117, -81, -83, -117, -85, -87,
|
336
|
+
-88, -89, -90, -91, -92, -93, -94, -95, -96, -97,
|
337
|
+
-98, -99, -100, -101, -102, -103, -104, -105, -106, -107,
|
338
|
+
-108, -109, -110, -111, -117, 143, -18, -19, -20, -21,
|
339
|
+
-22, -23, -48, -50, -75, -77, -78, -80, -82, -84,
|
340
|
+
-86, -112, -113 ]
|
337
341
|
|
338
342
|
racc_goto_table = [
|
339
|
-
|
340
|
-
|
341
|
-
nil, nil,
|
342
|
-
nil, nil,
|
343
|
-
nil, nil, nil, nil, nil,
|
343
|
+
123, 98, 95, 91, 65, 1, 90, 94, 64, 97,
|
344
|
+
32, 124, 33, nil, nil, nil, nil, nil, nil, nil,
|
345
|
+
nil, nil, 34, 35, 36, 37, 38, 39, nil, nil,
|
346
|
+
92, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
347
|
+
nil, nil, nil, nil, nil, 132, nil, nil, nil, nil,
|
344
348
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
345
|
-
nil, nil, nil, nil, nil, nil, nil, nil,
|
349
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, 134,
|
350
|
+
137, 139, nil, nil, nil, nil, nil, nil, nil, nil,
|
346
351
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
347
|
-
nil, nil, nil, nil, nil, nil,
|
348
|
-
nil, nil, 134, 136, nil, nil, nil, nil, 138 ]
|
352
|
+
nil, nil, nil, nil, nil, nil, 141 ]
|
349
353
|
|
350
354
|
racc_goto_check = [
|
351
|
-
|
352
|
-
|
353
|
-
nil, nil,
|
354
|
-
nil, nil,
|
355
|
-
nil, nil, nil, nil, nil,
|
356
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
357
|
-
nil, nil, nil, nil, nil, nil, nil, nil, 19, nil,
|
355
|
+
25, 23, 21, 19, 17, 1, 20, 22, 18, 24,
|
356
|
+
3, 26, 27, nil, nil, nil, nil, nil, nil, nil,
|
357
|
+
nil, nil, 1, 1, 1, 1, 1, 1, nil, nil,
|
358
|
+
1, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
359
|
+
nil, nil, nil, nil, nil, 17, nil, nil, nil, nil,
|
358
360
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
361
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, 19,
|
362
|
+
21, 23, nil, nil, nil, nil, nil, nil, nil, nil,
|
359
363
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
360
|
-
nil, nil,
|
364
|
+
nil, nil, nil, nil, nil, nil, 25 ]
|
361
365
|
|
362
366
|
racc_goto_pointer = [
|
363
|
-
nil,
|
364
|
-
nil, nil, nil, nil, nil, nil, nil, -
|
365
|
-
-
|
367
|
+
nil, 5, nil, 8, nil, nil, nil, nil, nil, nil,
|
368
|
+
nil, nil, nil, nil, nil, nil, nil, -19, -15, -21,
|
369
|
+
-18, -24, -19, -26, -18, -28, -17, -4 ]
|
366
370
|
|
367
371
|
racc_goto_default = [
|
368
372
|
nil, nil, 2, 3, 4, 5, 6, 7, 8, 9,
|
@@ -371,123 +375,126 @@ racc_goto_default = [
|
|
371
375
|
|
372
376
|
racc_reduce_table = [
|
373
377
|
0, 0, :racc_error,
|
374
|
-
0,
|
375
|
-
1,
|
376
|
-
2,
|
377
|
-
1,
|
378
|
-
1,
|
379
|
-
1,
|
380
|
-
1,
|
381
|
-
1,
|
382
|
-
1,
|
383
|
-
1,
|
384
|
-
1,
|
385
|
-
1,
|
386
|
-
1,
|
387
|
-
1,
|
388
|
-
1,
|
389
|
-
1,
|
390
|
-
1,
|
391
|
-
3,
|
392
|
-
3,
|
393
|
-
3,
|
394
|
-
3,
|
395
|
-
|
396
|
-
|
397
|
-
1,
|
398
|
-
1,
|
399
|
-
1,
|
400
|
-
1,
|
401
|
-
1,
|
402
|
-
1,
|
403
|
-
1,
|
404
|
-
1,
|
405
|
-
1,
|
406
|
-
1,
|
407
|
-
1,
|
408
|
-
1,
|
409
|
-
1,
|
410
|
-
1,
|
411
|
-
1,
|
412
|
-
1,
|
413
|
-
1,
|
414
|
-
1,
|
415
|
-
1,
|
416
|
-
1,
|
417
|
-
1,
|
418
|
-
|
419
|
-
1, 44, :
|
420
|
-
|
421
|
-
|
422
|
-
1, 45, :
|
423
|
-
|
424
|
-
1,
|
425
|
-
1,
|
426
|
-
1,
|
427
|
-
1,
|
428
|
-
1,
|
429
|
-
1,
|
430
|
-
1,
|
431
|
-
1,
|
432
|
-
1,
|
433
|
-
1,
|
434
|
-
1,
|
435
|
-
1,
|
436
|
-
1,
|
437
|
-
1,
|
438
|
-
1,
|
439
|
-
1,
|
440
|
-
1,
|
441
|
-
1,
|
442
|
-
1,
|
443
|
-
1,
|
444
|
-
|
445
|
-
1, 46, :
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
1,
|
453
|
-
|
454
|
-
1,
|
455
|
-
|
456
|
-
1,
|
457
|
-
|
458
|
-
1,
|
459
|
-
|
460
|
-
1,
|
461
|
-
1,
|
462
|
-
1,
|
463
|
-
1,
|
464
|
-
1,
|
465
|
-
1,
|
466
|
-
1,
|
467
|
-
1,
|
468
|
-
1,
|
469
|
-
1,
|
470
|
-
1,
|
471
|
-
1, 47, :_reduce_none,
|
472
|
-
1, 47, :_reduce_none,
|
473
|
-
1, 47, :_reduce_none,
|
474
|
-
1, 47, :_reduce_none,
|
475
|
-
1, 47, :_reduce_none,
|
476
|
-
1, 47, :_reduce_none,
|
477
|
-
1, 47, :_reduce_none,
|
478
|
-
1, 47, :_reduce_none,
|
479
|
-
1, 47, :_reduce_none,
|
480
|
-
1, 47, :_reduce_none,
|
378
|
+
0, 28, :_reduce_none,
|
379
|
+
1, 28, :_reduce_none,
|
380
|
+
2, 29, :_reduce_3,
|
381
|
+
1, 29, :_reduce_4,
|
382
|
+
1, 30, :_reduce_none,
|
383
|
+
1, 30, :_reduce_none,
|
384
|
+
1, 30, :_reduce_none,
|
385
|
+
1, 30, :_reduce_none,
|
386
|
+
1, 30, :_reduce_none,
|
387
|
+
1, 30, :_reduce_none,
|
388
|
+
1, 30, :_reduce_none,
|
389
|
+
1, 30, :_reduce_none,
|
390
|
+
1, 30, :_reduce_none,
|
391
|
+
1, 30, :_reduce_none,
|
392
|
+
1, 30, :_reduce_none,
|
393
|
+
1, 30, :_reduce_none,
|
394
|
+
1, 30, :_reduce_none,
|
395
|
+
3, 31, :_reduce_18,
|
396
|
+
3, 32, :_reduce_19,
|
397
|
+
3, 33, :_reduce_20,
|
398
|
+
3, 34, :_reduce_21,
|
399
|
+
3, 35, :_reduce_22,
|
400
|
+
3, 39, :_reduce_23,
|
401
|
+
1, 44, :_reduce_none,
|
402
|
+
1, 44, :_reduce_none,
|
403
|
+
1, 44, :_reduce_none,
|
404
|
+
1, 44, :_reduce_none,
|
405
|
+
1, 44, :_reduce_none,
|
406
|
+
1, 44, :_reduce_none,
|
407
|
+
1, 44, :_reduce_none,
|
408
|
+
1, 44, :_reduce_none,
|
409
|
+
1, 44, :_reduce_none,
|
410
|
+
1, 44, :_reduce_none,
|
411
|
+
1, 44, :_reduce_none,
|
412
|
+
1, 44, :_reduce_none,
|
413
|
+
1, 44, :_reduce_none,
|
414
|
+
1, 44, :_reduce_none,
|
415
|
+
1, 44, :_reduce_none,
|
416
|
+
1, 44, :_reduce_none,
|
417
|
+
1, 44, :_reduce_none,
|
418
|
+
1, 44, :_reduce_none,
|
419
|
+
1, 44, :_reduce_none,
|
420
|
+
1, 44, :_reduce_none,
|
421
|
+
1, 44, :_reduce_none,
|
422
|
+
1, 44, :_reduce_none,
|
423
|
+
1, 44, :_reduce_none,
|
424
|
+
1, 44, :_reduce_none,
|
425
|
+
2, 45, :_reduce_48,
|
426
|
+
1, 45, :_reduce_49,
|
427
|
+
3, 40, :_reduce_50,
|
428
|
+
1, 46, :_reduce_none,
|
429
|
+
1, 46, :_reduce_none,
|
430
|
+
1, 46, :_reduce_none,
|
431
|
+
1, 46, :_reduce_none,
|
432
|
+
1, 46, :_reduce_none,
|
433
|
+
1, 46, :_reduce_none,
|
434
|
+
1, 46, :_reduce_none,
|
435
|
+
1, 46, :_reduce_none,
|
436
|
+
1, 46, :_reduce_none,
|
437
|
+
1, 46, :_reduce_none,
|
438
|
+
1, 46, :_reduce_none,
|
439
|
+
1, 46, :_reduce_none,
|
440
|
+
1, 46, :_reduce_none,
|
441
|
+
1, 46, :_reduce_none,
|
442
|
+
1, 46, :_reduce_none,
|
443
|
+
1, 46, :_reduce_none,
|
444
|
+
1, 46, :_reduce_none,
|
445
|
+
1, 46, :_reduce_none,
|
446
|
+
1, 46, :_reduce_none,
|
447
|
+
1, 46, :_reduce_none,
|
448
|
+
1, 46, :_reduce_none,
|
449
|
+
1, 46, :_reduce_none,
|
450
|
+
1, 46, :_reduce_none,
|
451
|
+
1, 46, :_reduce_none,
|
452
|
+
2, 47, :_reduce_75,
|
453
|
+
1, 47, :_reduce_76,
|
454
|
+
3, 38, :_reduce_77,
|
455
|
+
3, 42, :_reduce_78,
|
456
|
+
1, 48, :_reduce_79,
|
457
|
+
2, 49, :_reduce_80,
|
458
|
+
1, 49, :_reduce_81,
|
459
|
+
3, 36, :_reduce_82,
|
460
|
+
1, 50, :_reduce_83,
|
461
|
+
2, 51, :_reduce_84,
|
462
|
+
1, 51, :_reduce_85,
|
463
|
+
3, 37, :_reduce_86,
|
464
|
+
1, 52, :_reduce_none,
|
465
|
+
1, 52, :_reduce_none,
|
466
|
+
1, 52, :_reduce_none,
|
467
|
+
1, 52, :_reduce_none,
|
468
|
+
1, 52, :_reduce_none,
|
469
|
+
1, 52, :_reduce_none,
|
470
|
+
1, 52, :_reduce_none,
|
471
|
+
1, 52, :_reduce_none,
|
472
|
+
1, 52, :_reduce_none,
|
473
|
+
1, 52, :_reduce_none,
|
474
|
+
1, 52, :_reduce_none,
|
481
475
|
1, 52, :_reduce_none,
|
482
|
-
|
483
|
-
|
484
|
-
1,
|
485
|
-
|
486
|
-
1,
|
476
|
+
1, 52, :_reduce_none,
|
477
|
+
1, 52, :_reduce_none,
|
478
|
+
1, 52, :_reduce_none,
|
479
|
+
1, 52, :_reduce_none,
|
480
|
+
1, 52, :_reduce_none,
|
481
|
+
1, 52, :_reduce_none,
|
482
|
+
1, 52, :_reduce_none,
|
483
|
+
1, 52, :_reduce_none,
|
484
|
+
1, 52, :_reduce_none,
|
485
|
+
1, 52, :_reduce_none,
|
486
|
+
1, 52, :_reduce_none,
|
487
|
+
1, 52, :_reduce_none,
|
488
|
+
1, 53, :_reduce_none,
|
489
|
+
2, 53, :_reduce_112,
|
490
|
+
3, 41, :_reduce_113,
|
491
|
+
1, 43, :_reduce_114,
|
492
|
+
2, 43, :_reduce_115,
|
493
|
+
1, 54, :_reduce_116 ]
|
487
494
|
|
488
|
-
racc_reduce_n =
|
495
|
+
racc_reduce_n = 117
|
489
496
|
|
490
|
-
racc_shift_n =
|
497
|
+
racc_shift_n = 143
|
491
498
|
|
492
499
|
racc_token_table = {
|
493
500
|
false => 0,
|
@@ -498,26 +505,27 @@ racc_token_table = {
|
|
498
505
|
:ITALIC_CLOSE => 5,
|
499
506
|
:STRIKE_OPEN => 6,
|
500
507
|
:STRIKE_CLOSE => 7,
|
501
|
-
:
|
502
|
-
:
|
503
|
-
:
|
504
|
-
:
|
505
|
-
:
|
506
|
-
:
|
507
|
-
:
|
508
|
-
:
|
509
|
-
:
|
510
|
-
:
|
511
|
-
:
|
512
|
-
:
|
513
|
-
:
|
514
|
-
:
|
515
|
-
:
|
516
|
-
:
|
517
|
-
:
|
518
|
-
:
|
519
|
-
|
520
|
-
|
508
|
+
:CODE_OPEN => 8,
|
509
|
+
:CODE_CLOSE => 9,
|
510
|
+
:KBD_OPEN => 10,
|
511
|
+
:KBD_CLOSE => 11,
|
512
|
+
:LABEL_OPEN => 12,
|
513
|
+
:LABEL_CLOSE => 13,
|
514
|
+
:REFERENCE_OPEN => 14,
|
515
|
+
:REFERENCE_CLOSE => 15,
|
516
|
+
:VERB_OPEN => 16,
|
517
|
+
:VERB_CLOSE => 17,
|
518
|
+
:FOOTNOTE_OPEN => 18,
|
519
|
+
:FOOTNOTE_CLOSE => 19,
|
520
|
+
:RUBY_OPEN => 20,
|
521
|
+
:RUBY_CLOSE => 21,
|
522
|
+
:IMAGE_OPEN => 22,
|
523
|
+
:IMAGE_CLOSE => 23,
|
524
|
+
:MANUEDO_OPEN => 24,
|
525
|
+
:MANUEDO_CLOSE => 25,
|
526
|
+
:OTHER => 26 }
|
527
|
+
|
528
|
+
racc_nt_base = 27
|
521
529
|
|
522
530
|
racc_use_result_var = false
|
523
531
|
|
@@ -546,15 +554,16 @@ Racc_token_to_s_table = [
|
|
546
554
|
"ITALIC_CLOSE",
|
547
555
|
"STRIKE_OPEN",
|
548
556
|
"STRIKE_CLOSE",
|
557
|
+
"CODE_OPEN",
|
558
|
+
"CODE_CLOSE",
|
559
|
+
"KBD_OPEN",
|
560
|
+
"KBD_CLOSE",
|
549
561
|
"LABEL_OPEN",
|
550
562
|
"LABEL_CLOSE",
|
551
563
|
"REFERENCE_OPEN",
|
552
564
|
"REFERENCE_CLOSE",
|
553
565
|
"VERB_OPEN",
|
554
566
|
"VERB_CLOSE",
|
555
|
-
"ERB_OPEN",
|
556
|
-
"ERB_CLOSE",
|
557
|
-
"HERB_OPEN",
|
558
567
|
"FOOTNOTE_OPEN",
|
559
568
|
"FOOTNOTE_CLOSE",
|
560
569
|
"RUBY_OPEN",
|
@@ -571,25 +580,25 @@ Racc_token_to_s_table = [
|
|
571
580
|
"emphasis",
|
572
581
|
"italic",
|
573
582
|
"strike",
|
583
|
+
"code",
|
584
|
+
"kbd",
|
574
585
|
"label",
|
575
586
|
"reference",
|
576
587
|
"ruby",
|
577
588
|
"footnote",
|
578
589
|
"image",
|
579
590
|
"verb",
|
580
|
-
"erb",
|
581
|
-
"herb",
|
582
591
|
"manuedo",
|
583
592
|
"normal_strings",
|
584
593
|
"image_string",
|
585
594
|
"image_strings",
|
586
595
|
"ruby_string",
|
587
596
|
"ruby_strings",
|
588
|
-
"verb_string",
|
589
597
|
"label_string",
|
590
598
|
"label_strings",
|
591
599
|
"reference_string",
|
592
600
|
"reference_strings",
|
601
|
+
"verb_string",
|
593
602
|
"verb_strings",
|
594
603
|
"normal_string" ]
|
595
604
|
|
@@ -659,8 +668,20 @@ module_eval(<<'.,.,', 'rafinlineparser.ry', 29)
|
|
659
668
|
end
|
660
669
|
.,.,
|
661
670
|
|
662
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
671
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 30)
|
663
672
|
def _reduce_21(val, _values)
|
673
|
+
Code.new(val[1])
|
674
|
+
end
|
675
|
+
.,.,
|
676
|
+
|
677
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 31)
|
678
|
+
def _reduce_22(val, _values)
|
679
|
+
Kbd.new(val[1])
|
680
|
+
end
|
681
|
+
.,.,
|
682
|
+
|
683
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 33)
|
684
|
+
def _reduce_23(val, _values)
|
664
685
|
@index[:footnote] ||= []
|
665
686
|
@index[:footnote] << {:content => val[1] }
|
666
687
|
Footnote.new([val[1], @index[:footnote].size])
|
@@ -668,10 +689,6 @@ module_eval(<<'.,.,', 'rafinlineparser.ry', 31)
|
|
668
689
|
end
|
669
690
|
.,.,
|
670
691
|
|
671
|
-
# reduce 22 omitted
|
672
|
-
|
673
|
-
# reduce 23 omitted
|
674
|
-
|
675
692
|
# reduce 24 omitted
|
676
693
|
|
677
694
|
# reduce 25 omitted
|
@@ -714,30 +731,30 @@ module_eval(<<'.,.,', 'rafinlineparser.ry', 31)
|
|
714
731
|
|
715
732
|
# reduce 44 omitted
|
716
733
|
|
717
|
-
|
718
|
-
|
734
|
+
# reduce 45 omitted
|
735
|
+
|
736
|
+
# reduce 46 omitted
|
737
|
+
|
738
|
+
# reduce 47 omitted
|
739
|
+
|
740
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 66)
|
741
|
+
def _reduce_48(val, _values)
|
719
742
|
val.join
|
720
743
|
end
|
721
744
|
.,.,
|
722
745
|
|
723
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
724
|
-
def
|
746
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 67)
|
747
|
+
def _reduce_49(val, _values)
|
725
748
|
val[0]
|
726
749
|
end
|
727
750
|
.,.,
|
728
751
|
|
729
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
730
|
-
def
|
752
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 68)
|
753
|
+
def _reduce_50(val, _values)
|
731
754
|
Image.new(val[1])
|
732
755
|
end
|
733
756
|
.,.,
|
734
757
|
|
735
|
-
# reduce 48 omitted
|
736
|
-
|
737
|
-
# reduce 49 omitted
|
738
|
-
|
739
|
-
# reduce 50 omitted
|
740
|
-
|
741
758
|
# reduce 51 omitted
|
742
759
|
|
743
760
|
# reduce 52 omitted
|
@@ -778,20 +795,28 @@ module_eval(<<'.,.,', 'rafinlineparser.ry', 65)
|
|
778
795
|
|
779
796
|
# reduce 70 omitted
|
780
797
|
|
781
|
-
|
782
|
-
|
798
|
+
# reduce 71 omitted
|
799
|
+
|
800
|
+
# reduce 72 omitted
|
801
|
+
|
802
|
+
# reduce 73 omitted
|
803
|
+
|
804
|
+
# reduce 74 omitted
|
805
|
+
|
806
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 97)
|
807
|
+
def _reduce_75(val, _values)
|
783
808
|
val.join
|
784
809
|
end
|
785
810
|
.,.,
|
786
811
|
|
787
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
788
|
-
def
|
812
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 98)
|
813
|
+
def _reduce_76(val, _values)
|
789
814
|
val[0]
|
790
815
|
end
|
791
816
|
.,.,
|
792
817
|
|
793
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
794
|
-
def
|
818
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 101)
|
819
|
+
def _reduce_77(val, _values)
|
795
820
|
base, text = val[1].split("|",2)
|
796
821
|
text ||= base
|
797
822
|
Ruby.new([base, text])
|
@@ -799,46 +824,32 @@ module_eval(<<'.,.,', 'rafinlineparser.ry', 97)
|
|
799
824
|
end
|
800
825
|
.,.,
|
801
826
|
|
802
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry', 105)
|
803
|
-
def _reduce_74(val, _values)
|
804
|
-
e = ERB.new("<%= #{val[1]} %>")
|
805
|
-
Plain.new(e.result)
|
806
|
-
end
|
807
|
-
.,.,
|
808
|
-
|
809
827
|
module_eval(<<'.,.,', 'rafinlineparser.ry', 108)
|
810
|
-
def
|
811
|
-
e = ERB.new("<% #{val[1]} %>")
|
812
|
-
Plain.new(e.result)
|
813
|
-
end
|
814
|
-
.,.,
|
815
|
-
|
816
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry', 112)
|
817
|
-
def _reduce_76(val, _values)
|
828
|
+
def _reduce_78(val, _values)
|
818
829
|
Manuedo.new(val[1])
|
819
830
|
end
|
820
831
|
.,.,
|
821
832
|
|
822
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
823
|
-
def
|
833
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 113)
|
834
|
+
def _reduce_79(val, _values)
|
824
835
|
val[0]
|
825
836
|
end
|
826
837
|
.,.,
|
827
838
|
|
828
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
829
|
-
def
|
839
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 116)
|
840
|
+
def _reduce_80(val, _values)
|
830
841
|
val.join
|
831
842
|
end
|
832
843
|
.,.,
|
833
844
|
|
834
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
835
|
-
def
|
845
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 117)
|
846
|
+
def _reduce_81(val, _values)
|
836
847
|
val[0]
|
837
848
|
end
|
838
849
|
.,.,
|
839
850
|
|
840
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
841
|
-
def
|
851
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 120)
|
852
|
+
def _reduce_82(val, _values)
|
842
853
|
label, title = val[1].split("|",2)
|
843
854
|
title ||= label
|
844
855
|
@index[:label] ||= []
|
@@ -848,26 +859,26 @@ module_eval(<<'.,.,', 'rafinlineparser.ry', 124)
|
|
848
859
|
end
|
849
860
|
.,.,
|
850
861
|
|
851
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
852
|
-
def
|
862
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 129)
|
863
|
+
def _reduce_83(val, _values)
|
853
864
|
val[0]
|
854
865
|
end
|
855
866
|
.,.,
|
856
867
|
|
857
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
858
|
-
def
|
868
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 131)
|
869
|
+
def _reduce_84(val, _values)
|
859
870
|
val.join
|
860
871
|
end
|
861
872
|
.,.,
|
862
873
|
|
863
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
864
|
-
def
|
874
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 132)
|
875
|
+
def _reduce_85(val, _values)
|
865
876
|
val[0]
|
866
877
|
end
|
867
878
|
.,.,
|
868
879
|
|
869
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
870
|
-
def
|
880
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 135)
|
881
|
+
def _reduce_86(val, _values)
|
871
882
|
title, uri = val[1].split("|",2)
|
872
883
|
uri ||= title
|
873
884
|
uri = "#" + uri.to_code if uri.gsub(/^\s*https*:\/\//,"") == uri
|
@@ -876,10 +887,6 @@ module_eval(<<'.,.,', 'rafinlineparser.ry', 139)
|
|
876
887
|
end
|
877
888
|
.,.,
|
878
889
|
|
879
|
-
# reduce 85 omitted
|
880
|
-
|
881
|
-
# reduce 86 omitted
|
882
|
-
|
883
890
|
# reduce 87 omitted
|
884
891
|
|
885
892
|
# reduce 88 omitted
|
@@ -924,32 +931,38 @@ module_eval(<<'.,.,', 'rafinlineparser.ry', 139)
|
|
924
931
|
|
925
932
|
# reduce 108 omitted
|
926
933
|
|
927
|
-
|
928
|
-
|
934
|
+
# reduce 109 omitted
|
935
|
+
|
936
|
+
# reduce 110 omitted
|
937
|
+
|
938
|
+
# reduce 111 omitted
|
939
|
+
|
940
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 168)
|
941
|
+
def _reduce_112(val, _values)
|
929
942
|
val
|
930
943
|
end
|
931
944
|
.,.,
|
932
945
|
|
933
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
934
|
-
def
|
946
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 170)
|
947
|
+
def _reduce_113(val, _values)
|
935
948
|
Verb.new(val[1])
|
936
949
|
end
|
937
950
|
.,.,
|
938
951
|
|
939
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
940
|
-
def
|
952
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 174)
|
953
|
+
def _reduce_114(val, _values)
|
941
954
|
Plain.new(val[0])
|
942
955
|
end
|
943
956
|
.,.,
|
944
957
|
|
945
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
946
|
-
def
|
958
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 175)
|
959
|
+
def _reduce_115(val, _values)
|
947
960
|
Plain.new([val[0].contents, val[1]])
|
948
961
|
end
|
949
962
|
.,.,
|
950
963
|
|
951
|
-
module_eval(<<'.,.,', 'rafinlineparser.ry',
|
952
|
-
def
|
964
|
+
module_eval(<<'.,.,', 'rafinlineparser.ry', 177)
|
965
|
+
def _reduce_116(val, _values)
|
953
966
|
val[0]
|
954
967
|
end
|
955
968
|
.,.,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raf-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- garin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|