raf-parser 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31af537333b05bd2b06141b9a48df2713633f01d
4
- data.tar.gz: aaca600f0f89c38ede056e73305fedc7c1baff87
3
+ metadata.gz: af19c289cec306caf69312d8d9668dafb7428062
4
+ data.tar.gz: 0218da92ad12232d0ad41c47c1e24043584e1aa5
5
5
  SHA512:
6
- metadata.gz: 8a0797b675b687f8d719844e2656538b2713613f40839fd2cbb146d4b1c2ccfae894d052404b95c26170a59ddd561539acc7d537f53be45f4d10998e7450d051
7
- data.tar.gz: 8f3a303caee507a6504b7ebcf950673206aa3c934f6da5813120b79a08c5c21ddaa4764a15f3267527cab3b347fe6ce7201531489e5850aa846446a44f56b6a3
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-01
1
+ 2013-12-04
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -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
 
@@ -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>"
@@ -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 ERB_OPEN ERB_CLOSE HERB_OPEN FOOTNOTE_OPEN FOOTNOTE_CLOSE RUBY_OPEN RUBY_CLOSE IMAGE_OPEN IMAGE_CLOSE MANUEDO_OPEN MANUEDO_CLOSE OTHER
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(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)}|#{Regexp.quote(ERB_OPEN)}|#{Regexp.quote(ERB_CLOSE)}|#{Regexp.quote(HERB_OPEN)})", other_re_mode)
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
@@ -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', 185)
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(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)}|#{Regexp.quote(ERB_OPEN)}|#{Regexp.quote(ERB_CLOSE)}|#{Regexp.quote(HERB_OPEN)})", other_re_mode)
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, 31, 18, 124, 19, 125, 26, 126, 27, 30,
236
- 28, 123, 23, 131, 24, 20, 132, 22, 133, 21,
237
- 114, 25, 122, 30, 64, 65, 66, 67, 68, 69,
238
- 79, 80, 77, 78, 84, 85, 74, 75, 76, 82,
239
- 83, 81, 130, 70, 71, 72, 73, 63, 17, 117,
240
- 18, nil, 19, nil, 26, nil, 27, nil, 28, nil,
241
- 23, nil, 24, 20, nil, 22, nil, 21, nil, 25,
242
- nil, 30, 39, 40, 41, 42, 43, 44, 54, 55,
243
- 52, 53, 58, 59, 49, 50, 51, 56, 57, 45,
244
- 46, 60, 128, 47, 48, 38, 17, nil, 18, nil,
245
- 19, nil, 26, nil, 27, 135, 28, nil, 23, 137,
246
- 24, 20, 17, 22, 18, 21, 19, 25, 26, 30,
247
- 27, 114, 28, 117, 23, nil, 24, 20, 17, 22,
248
- 18, 21, 19, 25, 26, 30, 27, nil, 28, nil,
249
- 23, nil, 24, 20, 17, 22, 18, 21, 19, 25,
250
- 26, 30, 27, nil, 28, nil, 23, nil, 24, 20,
251
- nil, 22, nil, 21, nil, 25, nil, 30, 39, 40,
252
- 41, 42, 43, 44, 54, 55, 52, 53, 58, 59,
253
- 49, 50, 51, 56, 57, 45, 46, 60, nil, 47,
254
- 48, 38, 64, 65, 66, 67, 68, 69, 79, 80,
255
- 77, 78, 84, 85, 74, 75, 76, 82, 83, 81,
256
- nil, 70, 71, 72, 73, 63, 90, 91, 92, 93,
257
- 94, 95, 105, 106, 103, 104, 111, nil, 100, 101,
258
- 102, 109, 110, 107, 108, 96, 97, 98, 99, 89,
259
- 90, 91, 92, 93, 94, 95, 105, 106, 103, 104,
260
- 111, nil, 100, 101, 102, 109, 110, 107, 108, 96,
261
- 97, 98, 99, 89, 17, nil, 18, nil, 19, nil,
262
- 26, nil, 27, nil, 28, nil, 23, nil, 24, 20,
263
- nil, 22, nil, 21, nil, 25, nil, 30, 90, 91,
264
- 92, 93, 94, 95, 105, 106, 103, 104, 111, nil,
265
- 100, 101, 102, 109, 110, 107, 108, 96, 97, 98,
266
- 99, 89, 90, 91, 92, 93, 94, 95, 105, 106,
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, 1, 0, 35, 0, 36, 0, 37, 0, 16,
272
- 0, 34, 0, 88, 0, 0, 112, 0, 113, 0,
273
- 26, 0, 31, 0, 86, 86, 86, 86, 86, 86,
274
- 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
275
- 86, 86, 86, 86, 86, 86, 86, 86, 2, 27,
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, 2,
278
- nil, 2, 61, 61, 61, 61, 61, 61, 61, 61,
279
- 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
280
- 61, 61, 61, 61, 61, 61, 17, nil, 17, nil,
281
- 17, nil, 17, nil, 17, 115, 17, nil, 17, 118,
282
- 17, 17, 18, 17, 18, 17, 18, 17, 18, 17,
283
- 18, 115, 18, 118, 18, nil, 18, 18, 19, 18,
284
- 19, 18, 19, 18, 19, 18, 19, nil, 19, nil,
285
- 19, nil, 19, 19, 20, 19, 20, 19, 20, 19,
286
- 20, 19, 20, nil, 20, nil, 20, nil, 20, 20,
287
- nil, 20, nil, 20, nil, 20, nil, 20, 21, 21,
288
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 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, nil, 24, 24, 24, 24, 24, 24, 24, 24,
297
- 24, 24, 24, 24, 25, nil, 25, nil, 25, nil,
298
- 25, nil, 25, nil, 25, nil, 25, nil, 25, 25,
299
- nil, 25, nil, 25, nil, 25, nil, 25, 28, 28,
300
- 28, 28, 28, 28, 28, 28, 28, 28, 28, nil,
301
- 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
302
- 28, 28, 121, 121, 121, 121, 121, 121, 121, 121,
303
- 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
304
- 121, 121, 121, 121, 121, 121 ]
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, 1, 46, nil, nil, nil, nil, nil, nil, nil,
308
- nil, nil, nil, nil, nil, nil, -16, 94, 110, 126,
309
- 142, 166, 190, 214, 238, 262, -5, 24, 286, nil,
310
- nil, 22, nil, nil, 8, -2, -2, -11, nil, 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, 70, nil, nil, nil, nil, nil, nil, nil, 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, 1, -6, nil, 96, nil, nil, 98, 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, -114, -2, -4, -5, -6, -7, -8, -9, -10,
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, -114, -114, -114, -114, -1, -114, -114, -114, -111,
326
- -113, -114, -3, -112, -114, -114, -114, -114, -22, -23,
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, -114, -46, -48, -49, -50, -51, -52, -53, -54,
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, -114, -72, -114, -85,
332
- -86, -87, -88, -89, -90, -91, -92, -93, -94, -95,
333
- -96, -97, -98, -99, -100, -101, -102, -103, -104, -105,
334
- -106, -107, -114, -114, -77, -114, -79, -81, -114, -83,
335
- -108, -114, 140, -18, -19, -20, -21, -45, -47, -71,
336
- -73, -74, -75, -76, -78, -80, -82, -84, -109, -110 ]
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
- 88, 112, 119, 116, 87, 120, 62, 1, 86, 61,
340
- 115, 32, 118, 121, 33, nil, nil, nil, nil, nil,
341
- nil, nil, nil, nil, 34, 35, 36, 37, nil, nil,
342
- nil, nil, 113, nil, nil, nil, nil, nil, nil, nil,
343
- nil, nil, nil, nil, nil, nil, 127, 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, 129, 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, 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
- 21, 21, 24, 22, 19, 21, 17, 1, 20, 18,
352
- 23, 3, 25, 26, 27, nil, nil, nil, nil, nil,
353
- nil, nil, nil, nil, 1, 1, 1, 1, nil, nil,
354
- nil, nil, 1, nil, nil, nil, nil, nil, nil, nil,
355
- nil, nil, nil, nil, nil, nil, 17, 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, 22, 24, nil, nil, nil, nil, 21 ]
364
+ nil, nil, nil, nil, nil, nil, 25 ]
361
365
 
362
366
  racc_goto_pointer = [
363
- nil, 7, nil, 9, nil, nil, nil, nil, nil, nil,
364
- nil, nil, nil, nil, nil, nil, nil, -15, -12, -18,
365
- -14, -23, -23, -16, -25, -15, -15, -2 ]
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, 27, :_reduce_none,
375
- 1, 27, :_reduce_none,
376
- 2, 28, :_reduce_3,
377
- 1, 28, :_reduce_4,
378
- 1, 29, :_reduce_none,
379
- 1, 29, :_reduce_none,
380
- 1, 29, :_reduce_none,
381
- 1, 29, :_reduce_none,
382
- 1, 29, :_reduce_none,
383
- 1, 29, :_reduce_none,
384
- 1, 29, :_reduce_none,
385
- 1, 29, :_reduce_none,
386
- 1, 29, :_reduce_none,
387
- 1, 29, :_reduce_none,
388
- 1, 29, :_reduce_none,
389
- 1, 29, :_reduce_none,
390
- 1, 29, :_reduce_none,
391
- 3, 30, :_reduce_18,
392
- 3, 31, :_reduce_19,
393
- 3, 32, :_reduce_20,
394
- 3, 36, :_reduce_21,
395
- 1, 43, :_reduce_none,
396
- 1, 43, :_reduce_none,
397
- 1, 43, :_reduce_none,
398
- 1, 43, :_reduce_none,
399
- 1, 43, :_reduce_none,
400
- 1, 43, :_reduce_none,
401
- 1, 43, :_reduce_none,
402
- 1, 43, :_reduce_none,
403
- 1, 43, :_reduce_none,
404
- 1, 43, :_reduce_none,
405
- 1, 43, :_reduce_none,
406
- 1, 43, :_reduce_none,
407
- 1, 43, :_reduce_none,
408
- 1, 43, :_reduce_none,
409
- 1, 43, :_reduce_none,
410
- 1, 43, :_reduce_none,
411
- 1, 43, :_reduce_none,
412
- 1, 43, :_reduce_none,
413
- 1, 43, :_reduce_none,
414
- 1, 43, :_reduce_none,
415
- 1, 43, :_reduce_none,
416
- 1, 43, :_reduce_none,
417
- 1, 43, :_reduce_none,
418
- 2, 44, :_reduce_45,
419
- 1, 44, :_reduce_46,
420
- 3, 37, :_reduce_47,
421
- 1, 45, :_reduce_none,
422
- 1, 45, :_reduce_none,
423
- 1, 45, :_reduce_none,
424
- 1, 45, :_reduce_none,
425
- 1, 45, :_reduce_none,
426
- 1, 45, :_reduce_none,
427
- 1, 45, :_reduce_none,
428
- 1, 45, :_reduce_none,
429
- 1, 45, :_reduce_none,
430
- 1, 45, :_reduce_none,
431
- 1, 45, :_reduce_none,
432
- 1, 45, :_reduce_none,
433
- 1, 45, :_reduce_none,
434
- 1, 45, :_reduce_none,
435
- 1, 45, :_reduce_none,
436
- 1, 45, :_reduce_none,
437
- 1, 45, :_reduce_none,
438
- 1, 45, :_reduce_none,
439
- 1, 45, :_reduce_none,
440
- 1, 45, :_reduce_none,
441
- 1, 45, :_reduce_none,
442
- 1, 45, :_reduce_none,
443
- 1, 45, :_reduce_none,
444
- 2, 46, :_reduce_71,
445
- 1, 46, :_reduce_72,
446
- 3, 35, :_reduce_73,
447
- 3, 39, :_reduce_74,
448
- 3, 40, :_reduce_75,
449
- 3, 41, :_reduce_76,
450
- 1, 48, :_reduce_77,
451
- 2, 49, :_reduce_78,
452
- 1, 49, :_reduce_79,
453
- 3, 33, :_reduce_80,
454
- 1, 50, :_reduce_81,
455
- 2, 51, :_reduce_82,
456
- 1, 51, :_reduce_83,
457
- 3, 34, :_reduce_84,
458
- 1, 47, :_reduce_none,
459
- 1, 47, :_reduce_none,
460
- 1, 47, :_reduce_none,
461
- 1, 47, :_reduce_none,
462
- 1, 47, :_reduce_none,
463
- 1, 47, :_reduce_none,
464
- 1, 47, :_reduce_none,
465
- 1, 47, :_reduce_none,
466
- 1, 47, :_reduce_none,
467
- 1, 47, :_reduce_none,
468
- 1, 47, :_reduce_none,
469
- 1, 47, :_reduce_none,
470
- 1, 47, :_reduce_none,
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
- 2, 52, :_reduce_109,
483
- 3, 38, :_reduce_110,
484
- 1, 42, :_reduce_111,
485
- 2, 42, :_reduce_112,
486
- 1, 53, :_reduce_113 ]
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 = 114
495
+ racc_reduce_n = 117
489
496
 
490
- racc_shift_n = 140
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
- :LABEL_OPEN => 8,
502
- :LABEL_CLOSE => 9,
503
- :REFERENCE_OPEN => 10,
504
- :REFERENCE_CLOSE => 11,
505
- :VERB_OPEN => 12,
506
- :VERB_CLOSE => 13,
507
- :ERB_OPEN => 14,
508
- :ERB_CLOSE => 15,
509
- :HERB_OPEN => 16,
510
- :FOOTNOTE_OPEN => 17,
511
- :FOOTNOTE_CLOSE => 18,
512
- :RUBY_OPEN => 19,
513
- :RUBY_CLOSE => 20,
514
- :IMAGE_OPEN => 21,
515
- :IMAGE_CLOSE => 22,
516
- :MANUEDO_OPEN => 23,
517
- :MANUEDO_CLOSE => 24,
518
- :OTHER => 25 }
519
-
520
- racc_nt_base = 26
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', 31)
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
- module_eval(<<'.,.,', 'rafinlineparser.ry', 63)
718
- def _reduce_45(val, _values)
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', 64)
724
- def _reduce_46(val, _values)
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', 65)
730
- def _reduce_47(val, _values)
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
- module_eval(<<'.,.,', 'rafinlineparser.ry', 93)
782
- def _reduce_71(val, _values)
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', 94)
788
- def _reduce_72(val, _values)
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', 97)
794
- def _reduce_73(val, _values)
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 _reduce_75(val, _values)
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', 117)
823
- def _reduce_77(val, _values)
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', 120)
829
- def _reduce_78(val, _values)
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', 121)
835
- def _reduce_79(val, _values)
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', 124)
841
- def _reduce_80(val, _values)
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', 133)
852
- def _reduce_81(val, _values)
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', 135)
858
- def _reduce_82(val, _values)
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', 136)
864
- def _reduce_83(val, _values)
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', 139)
870
- def _reduce_84(val, _values)
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
- module_eval(<<'.,.,', 'rafinlineparser.ry', 171)
928
- def _reduce_109(val, _values)
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', 173)
934
- def _reduce_110(val, _values)
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', 177)
940
- def _reduce_111(val, _values)
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', 178)
946
- def _reduce_112(val, _values)
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', 180)
952
- def _reduce_113(val, _values)
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.0
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-01 00:00:00.000000000 Z
11
+ date: 2013-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler