faml 0.2.16 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 060e986d85d08a46e9341eb16d6998554f6839a1
4
- data.tar.gz: 4883f1ddec473a08bbad24b2d739c6d0b5ed9c1f
3
+ metadata.gz: 23f087ba97e9ffb104d240af74b6704fd100a5e8
4
+ data.tar.gz: 2e5f8a48de615415b4343fa7f818106b26f8d3ae
5
5
  SHA512:
6
- metadata.gz: 7593bc4d281142cb9c35d6bd097aba81c5476076614306bf102c46094c4f3327e61ac0df2d0695c59c3c58c177a9fd68c85ab399fdf8ed753614349ac47813eb
7
- data.tar.gz: 17581ff5aec1be1dbab01809f8e3b4533e305fadf2985bf164c1e9fc3e5a46890d563a761730cd1185348145ffffebb673c54f91702f47a6fe10676ab4a0ece2
6
+ metadata.gz: 84c1f440f966f32e7163fe610317d5fa4da8d625204aa72b8e09488fd872c2b3d62ff26c2ff83ea3e743bc48d351257be80f02dbffcc44d219266417f6f6aa29
7
+ data.tar.gz: 4ff1f89b8bf2935abe157da73197c12614a32a7fadfb644b596d996868ebc4d99101243ae83b04833488734393522645125aabfb2b50409bd4d57fd35fa4644d
@@ -1,3 +1,8 @@
1
+ ## 0.3.0 (2015-09-13)
2
+ - Move Haml parser and AST definition to haml_parser
3
+ - https://github.com/eagletmt/haml_parser
4
+ - Remove `faml parse` subcommand
5
+
1
6
  ## 0.2.16 (2015-08-05)
2
7
  - Fix incompatibility to tilt 2.x
3
8
  - https://github.com/eagletmt/faml/issues/23
data/README.md CHANGED
@@ -92,9 +92,9 @@ If you find other incompatibility, please report it to me :-p.
92
92
  I use [temple](https://github.com/judofyr/temple) to achieve faster template rendering.
93
93
  It's used by [slim](https://github.com/slim-template/slim) template language & engine which is known as fast.
94
94
 
95
- 1. Faml::Parser converts source language (Haml template) to own AST (Faml::Ast) .
96
- - You can see the Faml::Ast by running `faml parse template.haml` .
97
- 2. Faml::Compiler compiles Faml::Ast into Temple AST.
95
+ 1. HamlParser::Parser converts source language (Haml template) to own AST (HamlParser::Ast) .
96
+ - You can see the HamlParser::Ast by running `haml_parser template.haml` .
97
+ 2. Faml::Compiler compiles HamlParser::Ast into Temple AST.
98
98
  - You can see the Temple AST by running `faml temple template.haml` .
99
99
  3. Temple compiles its AST into Ruby code.
100
100
  - You can see the Ruby code by running `faml compile template.haml` .
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.required_ruby_version = ">= 2.0.0"
22
22
 
23
23
  spec.add_dependency "escape_utils"
24
+ spec.add_dependency "haml_parser", ">= 0.1.0"
24
25
  spec.add_dependency "parser"
25
26
  spec.add_dependency "temple", ">= 0.7.0"
26
27
  spec.add_dependency "tilt"
@@ -1,13 +1,13 @@
1
1
  # Incompatibilities
2
2
  ## Versions
3
- - Haml 4.0.6
4
- - Faml 0.2.15
5
- - Hamlit 1.7.1
3
+ - Haml 4.0.7
4
+ - Faml 0.3.0
5
+ - Hamlit 1.7.2
6
6
 
7
7
  ## Table of contents
8
8
  - [spec/compiler_newline_spec.md](spec/compiler_newline_spec.md)
9
9
  - [spec/render/attribute_spec.md](spec/render/attribute_spec.md)
10
- - [spec/render/comment_spec.md](spec/render/comment_spec.md)
10
+ - [spec/render/comment_spec.md](spec/render/comment_spec.md) (Hamlit's incompatibility)
11
11
  - [spec/render/doctype_spec.md](spec/render/doctype_spec.md)
12
12
  - [spec/render/element_spec.md](spec/render/element_spec.md)
13
13
  - [spec/render/filters/cdata_spec.md](spec/render/filters/cdata_spec.md) (Hamlit's incompatibility)
@@ -17,7 +17,6 @@
17
17
  - [spec/render/filters/markdown_spec.md](spec/render/filters/markdown_spec.md)
18
18
  - [spec/render/filters/preserve_spec.md](spec/render/filters/preserve_spec.md) (Hamlit's incompatibility)
19
19
  - [spec/render/helpers_spec.md](spec/render/helpers_spec.md) (Hamlit's incompatibility)
20
- - [spec/render/indent_spec.md](spec/render/indent_spec.md)
21
20
  - [spec/render/multiline_spec.md](spec/render/multiline_spec.md) (Hamlit's incompatibility)
22
21
  - [spec/render/newline_spec.md](spec/render/newline_spec.md) (Hamlit's incompatibility)
23
22
  - [spec/render/plain_spec.md](spec/render/plain_spec.md) (Hamlit's incompatibility)
@@ -1,4 +1,4 @@
1
- # [./spec/render/attribute_spec.rb:52](../../../spec/render/attribute_spec.rb#L52)
1
+ # [./spec/render/attribute_spec.rb:48](../../../spec/render/attribute_spec.rb#L48)
2
2
  ## Input
3
3
  ```haml
4
4
  - h1 = {class: 'c1', id: ['id1', 'id3']}
@@ -19,7 +19,7 @@
19
19
 
20
20
  ```
21
21
 
22
- # [./spec/render/attribute_spec.rb:65](../../../spec/render/attribute_spec.rb#L65)
22
+ # [./spec/render/attribute_spec.rb:61](../../../spec/render/attribute_spec.rb#L61)
23
23
  ## Input
24
24
  ```haml
25
25
  %span.foo{class: "foo bar"}
@@ -37,7 +37,7 @@
37
37
 
38
38
  ```
39
39
 
40
- # [./spec/render/attribute_spec.rb:75](../../../spec/render/attribute_spec.rb#L75)
40
+ # [./spec/render/attribute_spec.rb:71](../../../spec/render/attribute_spec.rb#L71)
41
41
  ## Input
42
42
  ```haml
43
43
  %span{class: "x\"y'z"} hello
@@ -55,7 +55,7 @@
55
55
 
56
56
  ```
57
57
 
58
- # [./spec/render/attribute_spec.rb:92](../../../spec/render/attribute_spec.rb#L92)
58
+ # [./spec/render/attribute_spec.rb:84](../../../spec/render/attribute_spec.rb#L84)
59
59
  ## Input (with options={:format=>:xhtml})
60
60
  ```haml
61
61
  - foo = true
@@ -74,7 +74,7 @@
74
74
 
75
75
  ```
76
76
 
77
- # [./spec/render/attribute_spec.rb:92](../../../spec/render/attribute_spec.rb#L92)
77
+ # [./spec/render/attribute_spec.rb:84](../../../spec/render/attribute_spec.rb#L84)
78
78
  ## Input (with options={:format=>:xhtml})
79
79
  ```haml
80
80
  - h = {foo: true, bar: 1}
@@ -93,7 +93,7 @@
93
93
 
94
94
  ```
95
95
 
96
- # [./spec/render/attribute_spec.rb:99](../../../spec/render/attribute_spec.rb#L99)
96
+ # [./spec/render/attribute_spec.rb:91](../../../spec/render/attribute_spec.rb#L91)
97
97
  ## Input
98
98
  ```haml
99
99
  %span{foo: {bar: 1+2}} hello
@@ -111,7 +111,7 @@
111
111
 
112
112
  ```
113
113
 
114
- # [./spec/render/attribute_spec.rb:103](../../../spec/render/attribute_spec.rb#L103)
114
+ # [./spec/render/attribute_spec.rb:95](../../../spec/render/attribute_spec.rb#L95)
115
115
  ## Input
116
116
  ```haml
117
117
  - attrs = { foo: 1, bar: { hoge: :fuga }, baz: true }
@@ -137,7 +137,7 @@
137
137
 
138
138
  ```
139
139
 
140
- # [./spec/render/attribute_spec.rb:117](../../../spec/render/attribute_spec.rb#L117)
140
+ # [./spec/render/attribute_spec.rb:109](../../../spec/render/attribute_spec.rb#L109)
141
141
  ## Input
142
142
  ```haml
143
143
  - data = { foo: 1 }
@@ -157,7 +157,7 @@
157
157
 
158
158
  ```
159
159
 
160
- # [./spec/render/attribute_spec.rb:124](../../../spec/render/attribute_spec.rb#L124)
160
+ # [./spec/render/attribute_spec.rb:116](../../../spec/render/attribute_spec.rb#L116)
161
161
  ## Input
162
162
  ```haml
163
163
  %span{foo: {bar: 1+2}} hello
@@ -175,31 +175,7 @@
175
175
 
176
176
  ```
177
177
 
178
- # [./spec/render/attribute_spec.rb:157](../../../spec/render/attribute_spec.rb#L157)
179
- ## Input
180
- ```haml
181
- %span{foo: 1
182
- , bar: 2} hello
183
-
184
- ```
185
-
186
- ## Faml (Error)
187
- ```html
188
- Unmatched brace
189
- ```
190
-
191
- ## Haml (Error)
192
- ```html
193
- Unbalanced brackets.
194
- ```
195
-
196
- ## Hamlit
197
- ```html
198
- <span bar='2' foo='1'>hello</span>
199
-
200
- ```
201
-
202
- # [./spec/render/attribute_spec.rb:166](../../../spec/render/attribute_spec.rb#L166)
178
+ # [./spec/render/attribute_spec.rb:138](../../../spec/render/attribute_spec.rb#L138)
203
179
  ## Input
204
180
  ```haml
205
181
  %span{data: {foo: 1, bar: 'baz', :hoge => :fuga, k1: { k2: 'v3' }}} hello
@@ -217,7 +193,7 @@ Unbalanced brackets.
217
193
 
218
194
  ```
219
195
 
220
- # [./spec/render/attribute_spec.rb:174](../../../spec/render/attribute_spec.rb#L174)
196
+ # [./spec/render/attribute_spec.rb:146](../../../spec/render/attribute_spec.rb#L146)
221
197
  ## Input
222
198
  ```haml
223
199
  %span{data: {foo: 1, bar: 2+3}} hello
@@ -235,7 +211,7 @@ Unbalanced brackets.
235
211
 
236
212
  ```
237
213
 
238
- # [./spec/render/attribute_spec.rb:178](../../../spec/render/attribute_spec.rb#L178)
214
+ # [./spec/render/attribute_spec.rb:150](../../../spec/render/attribute_spec.rb#L150)
239
215
  ## Input
240
216
  ```haml
241
217
  - data = { foo: 1, bar: 2 }
@@ -255,7 +231,7 @@ Unbalanced brackets.
255
231
 
256
232
  ```
257
233
 
258
- # [./spec/render/attribute_spec.rb:186](../../../spec/render/attribute_spec.rb#L186)
234
+ # [./spec/render/attribute_spec.rb:158](../../../spec/render/attribute_spec.rb#L158)
259
235
  ## Input
260
236
  ```haml
261
237
  %span{b: __LINE__,
@@ -275,185 +251,3 @@ Unbalanced brackets.
275
251
 
276
252
  ```
277
253
 
278
- # [./spec/render/attribute_spec.rb:212](../../../spec/render/attribute_spec.rb#L212)
279
- ## Input
280
- ```haml
281
- %span{data: {foo: 1,
282
- bar: 2}}
283
- %span hello
284
-
285
- ```
286
-
287
- ## Faml, Haml
288
- ```html
289
- <span data-bar='2' data-foo='1'>
290
- <span>hello</span>
291
- </span>
292
-
293
- ```
294
-
295
- ## Hamlit
296
- ```html
297
- <span data-foo='1' data-bar='2'>
298
- <span>hello</span>
299
- </span>
300
-
301
- ```
302
-
303
- # [./spec/render/attribute_spec.rb:220](../../../spec/render/attribute_spec.rb#L220)
304
- ## Input
305
- ```haml
306
- %span(foo=1
307
-
308
- bar=3) hello
309
-
310
- ```
311
-
312
- ## Faml, Haml
313
- ```html
314
- <span bar='3' foo='1'>hello</span>
315
-
316
- ```
317
-
318
- ## Hamlit
319
- ```html
320
- <span foo='3'>hello</span>
321
-
322
- ```
323
-
324
- # [./spec/render/attribute_spec.rb:237](../../../spec/render/attribute_spec.rb#L237)
325
- ## Input
326
- ```haml
327
- %span(foo bar=1) hello
328
- ```
329
-
330
- ## Faml, Haml
331
- ```html
332
- <span bar='1' foo>hello</span>
333
-
334
- ```
335
-
336
- ## Hamlit
337
- ```html
338
- <span = foo>hello</span>
339
-
340
- ```
341
-
342
- # [./spec/render/attribute_spec.rb:241](../../../spec/render/attribute_spec.rb#L241)
343
- ## Input
344
- ```haml
345
- %span(foo=1 bar='baz#{1 + 2}') hello
346
- ```
347
-
348
- ## Faml, Haml
349
- ```html
350
- <span bar='baz3' foo='1'>hello</span>
351
-
352
- ```
353
-
354
- ## Hamlit
355
- ```html
356
- <span bar='baz#{1 + 2}' foo='1'>hello</span>
357
-
358
- ```
359
-
360
- # [./spec/render/attribute_spec.rb:246](../../../spec/render/attribute_spec.rb#L246)
361
- ## Input
362
- ```haml
363
- %span(foo=1 bar="ba\"z") hello
364
- ```
365
-
366
- ## Faml, Hamlit
367
- ```html
368
- <span bar='ba&quot;z' foo='1'>hello</span>
369
-
370
- ```
371
-
372
- ## Haml
373
- ```html
374
- <span bar='ba"z' foo='1'>hello</span>
375
-
376
- ```
377
-
378
- # [./spec/render/attribute_spec.rb:246](../../../spec/render/attribute_spec.rb#L246)
379
- ## Input
380
- ```haml
381
- %span(foo=1 bar='ba\'z') hello
382
- ```
383
-
384
- ## Faml, Hamlit
385
- ```html
386
- <span bar='ba&#39;z' foo='1'>hello</span>
387
-
388
- ```
389
-
390
- ## Haml
391
- ```html
392
- <span bar="ba'z" foo='1'>hello</span>
393
-
394
- ```
395
-
396
- # [./spec/render/attribute_spec.rb:255](../../../spec/render/attribute_spec.rb#L255)
397
- ## Input
398
- ```haml
399
- %span(foo=1 3.14=3) hello
400
- ```
401
-
402
- ## Faml (Error)
403
- ```html
404
- Invalid attribute list (missing attribute name)
405
- ```
406
-
407
- ## Haml (Error)
408
- ```html
409
- Invalid attribute list: "(foo=1 3.14=3)".
410
- ```
411
-
412
- ## Hamlit
413
- ```html
414
- <span 3.14 foo='1'>hello</span>
415
-
416
- ```
417
-
418
- # [./spec/render/attribute_spec.rb:259](../../../spec/render/attribute_spec.rb#L259)
419
- ## Input
420
- ```haml
421
- %span(foo=1 bar=) hello
422
- ```
423
-
424
- ## Faml (Error)
425
- ```html
426
- Invalid attribute list (invalid variable name)
427
- ```
428
-
429
- ## Haml (Error)
430
- ```html
431
- Invalid attribute list: "(foo=1 bar=)".
432
- ```
433
-
434
- ## Hamlit
435
- ```html
436
- <span bar foo='1'>hello</span>
437
-
438
- ```
439
-
440
- # [./spec/render/attribute_spec.rb:271](../../../spec/render/attribute_spec.rb#L271)
441
- ## Input
442
- ```haml
443
- %span(b=__LINE__
444
- a=__LINE__)
445
-
446
- ```
447
-
448
- ## Faml
449
- ```html
450
- <span a='2' b='1'></span>
451
-
452
- ```
453
-
454
- ## Haml, Hamlit
455
- ```html
456
- <span a='1' b='1'></span>
457
-
458
- ```
459
-
@@ -17,26 +17,3 @@
17
17
 
18
18
  ```
19
19
 
20
- # [./spec/render/comment_spec.rb:51](../../../spec/render/comment_spec.rb#L51)
21
- ## Input
22
- ```haml
23
- /[[if IE]
24
- ```
25
-
26
- ## Faml (Error)
27
- ```html
28
- Unmatched brackets in conditional comment
29
- ```
30
-
31
- ## Haml (Error)
32
- ```html
33
- Unbalanced brackets.
34
- ```
35
-
36
- ## Hamlit
37
- ```html
38
- <!--[[if IE]>
39
- <![endif]-->
40
-
41
- ```
42
-
@@ -1,4 +1,4 @@
1
- # [./spec/render/element_spec.rb:98](../../../spec/render/element_spec.rb#L98)
1
+ # [./spec/render/element_spec.rb:56](../../../spec/render/element_spec.rb#L56)
2
2
  ## Input
3
3
  ```haml
4
4
  - @var = '</span>'
@@ -72,23 +72,6 @@
72
72
 
73
73
  ```
74
74
 
75
- # [./spec/render/newline_spec.rb:71](../../../spec/render/newline_spec.rb#L71)
76
- ## Input
77
- ```haml
78
- %div{foo: :bar} <b>hello</b>
79
- ```
80
-
81
- ## Faml, Haml
82
- ```html
83
- <div foo='bar'><b>hello</b></div>
84
-
85
- ```
86
-
87
- ## Hamlit (Error)
88
- ```html
89
- Generator supports only core expressions - found ["b>{foo: :bar}"]
90
- ```
91
-
92
75
  # [./spec/render/newline_spec.rb:71](../../../spec/render/newline_spec.rb#L71)
93
76
  ## Input
94
77
  ```haml
@@ -18,12 +18,6 @@ module Faml
18
18
  puts compile_file(file, format: options[:format].to_sym)
19
19
  end
20
20
 
21
- desc 'parse FILE', 'Render faml AST'
22
- def parse(file)
23
- require 'pp'
24
- pp parse_file(file)
25
- end
26
-
27
21
  desc 'temple FILE', 'Render temple AST'
28
22
  option :format, type: :string, default: :html, desc: 'HTML format'
29
23
  def temple(file)
@@ -48,7 +42,7 @@ module Faml
48
42
  end
49
43
 
50
44
  def parse_file(file)
51
- Faml::Parser.new(filename: file).call(File.read(file))
45
+ HamlParser::Parser.new(filename: file).call(File.read(file))
52
46
  end
53
47
  end
54
48
  end