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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fcd4572f6244e74518ddb988910f066627aff8e4
4
- data.tar.gz: a36a4d62484529f05dfecd1664e7310e944479ef
3
+ metadata.gz: b683fbc047148da1f4c11cd6b4f8469f1a256ccb
4
+ data.tar.gz: 4385ec410097c8f4a026f6471ccab88d54ae5fe9
5
5
  SHA512:
6
- metadata.gz: 8509763bef19d45729b5b5e932891a4ba30a7c698c64d254d22a2dd954c8c987505697ea0b503f3ff2ecd2568c0bce250136fa90f86fa43f567f20b77b6570b4
7
- data.tar.gz: 55290754b7ac6ead257b0a2bf6e25b4ef1b662c76ed18b2664e21a0761733b87c39e679c3a325ef8050d206b19fee5de6217b98f47134ea904491717f36398fd
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
- compiler = Compiler::ICR.new(s = Scanner::Liquidscript.new(data))
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
@@ -1,5 +1,5 @@
1
1
  module Liquidscript
2
2
 
3
3
  # The current version of liquidscript.
4
- VERSION = "0.7.2".freeze
4
+ VERSION = "0.7.3".freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquidscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Rodi