herbgobbler 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/grammer/erb_grammer.treetop +34 -1
  2. metadata +4 -4
@@ -1,6 +1,8 @@
1
1
  grammar ERBGrammer
2
2
  rule erb
3
- ( processing_instruction /
3
+ (
4
+ ignorable_javascript_tag /
5
+ processing_instruction /
4
6
  erb_string /
5
7
  erb_block /
6
8
  ignorable_script_tag_content /
@@ -100,6 +102,20 @@ grammar ERBGrammer
100
102
  }
101
103
  end
102
104
 
105
+ rule ignorable_javascript_tag
106
+ not_combindable_erb_block_start whitespace* 'javascript_tag' (!(not_combindable_erb_block_start whitespace* 'end' whitespace* not_combindable_erb_block_end) .)+ <IgnorableTagNode>
107
+ {
108
+ def can_be_combined?
109
+ false
110
+ end
111
+
112
+ def node_name
113
+ "ignorable_javascript_tag"
114
+ end
115
+ }
116
+
117
+ end
118
+
103
119
  rule erb_block
104
120
  start_block:'<%' block_contents:((!erb_block_end .)*) end_block:not_combindable_erb_block_end <NonTextNode>
105
121
  {
@@ -124,6 +140,21 @@ grammar ERBGrammer
124
140
 
125
141
  end
126
142
 
143
+ rule not_combindable_erb_block_start
144
+ ('<%' / '<%-') <NonTextNode>
145
+ {
146
+ def node_name
147
+ "not_combindable_erb_block_start"
148
+ end
149
+
150
+ def can_be_combined?
151
+ false
152
+ end
153
+
154
+ }
155
+
156
+ end
157
+
127
158
  rule not_combindable_erb_block_end
128
159
  ('%>' / '-%>') <NonTextNode>
129
160
  {
@@ -168,6 +199,7 @@ grammar ERBGrammer
168
199
  end
169
200
 
170
201
 
202
+
171
203
  rule html_self_contained
172
204
  start_tag:'<' tag_name:([a-zA-Z])+ tag_contents:(!'/>' (erb_string / .))* end_tag:'/>' <NonTextNode>
173
205
  {
@@ -256,6 +288,7 @@ grammar ERBGrammer
256
288
  def node_name
257
289
  "whitespace"
258
290
  end
291
+
259
292
  def white_space?
260
293
  true
261
294
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herbgobbler
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Douglas Sellers
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-06 00:00:00 -08:00
18
+ date: 2012-02-28 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency