liquidscript 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/liquidscript.rb +11 -2
- data/lib/liquidscript/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b683fbc047148da1f4c11cd6b4f8469f1a256ccb
|
4
|
+
data.tar.gz: 4385ec410097c8f4a026f6471ccab88d54ae5fe9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 390a711415c9018ea223de423ed28d21fedf9117f120b718a23a7ad457827e4e6564cf35562ed01a335c010bf6c41893eb8921ea889ab8d800abe19335038bb6
|
7
|
+
data.tar.gz: 334a33e878f3d6b645490c3c123dc59d36c256a7b5d73321a1364e66cda168c5860c58bef24fe29f5031b21d4f7f42152a8dc8b79c13239098631781d438239d
|
data/lib/liquidscript.rb
CHANGED
@@ -11,9 +11,18 @@ if defined? ::Sprockets
|
|
11
11
|
end
|
12
12
|
|
13
13
|
module Liquidscript
|
14
|
-
def self.compile(data)
|
15
|
-
|
14
|
+
def self.compile(data, options = {})
|
15
|
+
scanner = Scanner::Liquidscript.new(data)
|
16
|
+
if options[:tokens]
|
17
|
+
scanner.each.to_a.to_sexp
|
18
|
+
end
|
19
|
+
|
20
|
+
compiler = Compiler::ICR.new(scanner)
|
16
21
|
compiler.compile
|
22
|
+
if options[:ast]
|
23
|
+
compiler.top.to_sexp
|
24
|
+
end
|
25
|
+
|
17
26
|
Generator::Javascript.new(compiler.top).generate
|
18
27
|
end
|
19
28
|
end
|
data/lib/liquidscript/version.rb
CHANGED