liquidscript 0.7.1 → 0.7.2
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 +4 -4
- data/bin/lscript +18 -7
- data/lib/liquidscript/compiler/icr/literals.rb +8 -4
- data/lib/liquidscript/version.rb +1 -1
- data/spec/fixtures/inline.generate.yml +10 -0
- data/spec/liquidscript/node_spec.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcd4572f6244e74518ddb988910f066627aff8e4
|
4
|
+
data.tar.gz: a36a4d62484529f05dfecd1664e7310e944479ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8509763bef19d45729b5b5e932891a4ba30a7c698c64d254d22a2dd954c8c987505697ea0b503f3ff2ecd2568c0bce250136fa90f86fa43f567f20b77b6570b4
|
7
|
+
data.tar.gz: 55290754b7ac6ead257b0a2bf6e25b4ef1b662c76ed18b2664e21a0761733b87c39e679c3a325ef8050d206b19fee5de6217b98f47134ea904491717f36398fd
|
data/bin/lscript
CHANGED
@@ -10,14 +10,25 @@ end
|
|
10
10
|
infile = ARGV.shift
|
11
11
|
outfile = ARGV.shift || infile.gsub(/\.liq\Z/, ".js")
|
12
12
|
|
13
|
-
|
13
|
+
if infile == '-'
|
14
|
+
infile = $stdin
|
15
|
+
else
|
16
|
+
infile = File.open(infile, "r")
|
17
|
+
end
|
18
|
+
|
19
|
+
if outfile == '-'
|
20
|
+
outfile = $stdout
|
21
|
+
else
|
22
|
+
outfile = File.open(outfile, "w")
|
23
|
+
end
|
14
24
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
25
|
+
begin
|
26
|
+
out = Liquidscript.compile(infile.read)
|
27
|
+
outfile.write(out)
|
28
|
+
rescue StandardError => e
|
19
29
|
$stderr.puts "ERROR: #{e.class}: #{e.message}"
|
20
30
|
$stderr.puts e.backtrace[0..5].map { |s| "\t#{s.gsub(/^.*?\/lib\/liquidscript\//, "")}" }.join("\n")
|
21
|
-
|
22
|
-
|
31
|
+
ensure
|
32
|
+
[infile, outfile].each(&:close)
|
23
33
|
end
|
34
|
+
|
@@ -177,7 +177,6 @@ module Liquidscript
|
|
177
177
|
|
178
178
|
def compile_function_with_parameters(parameters)
|
179
179
|
shift :arrow
|
180
|
-
shift :lbrace
|
181
180
|
|
182
181
|
expressions = Liquidscript::ICR::Set.new
|
183
182
|
expressions.context = Liquidscript::ICR::Context.new
|
@@ -194,9 +193,14 @@ module Liquidscript
|
|
194
193
|
expressions << compile_expression
|
195
194
|
end
|
196
195
|
|
197
|
-
|
198
|
-
|
199
|
-
|
196
|
+
unless peek?(:lbrace)
|
197
|
+
expression.call
|
198
|
+
else
|
199
|
+
shift :lbrace
|
200
|
+
loop do
|
201
|
+
expect :rbrace => action.end_loop,
|
202
|
+
:_ => expression
|
203
|
+
end
|
200
204
|
end
|
201
205
|
|
202
206
|
code :function, @set.pop
|
data/lib/liquidscript/version.rb
CHANGED
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.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Rodi
|
@@ -165,6 +165,7 @@ files:
|
|
165
165
|
- spec/fixtures/function.generate.yml
|
166
166
|
- spec/fixtures/get.generate.yml
|
167
167
|
- spec/fixtures/heredoc.generate.yml
|
168
|
+
- spec/fixtures/inline.generate.yml
|
168
169
|
- spec/fixtures/literals.generate.yml
|
169
170
|
- spec/fixtures/loop.generate.yml
|
170
171
|
- spec/fixtures/main.compile.yml
|
@@ -225,6 +226,7 @@ test_files:
|
|
225
226
|
- spec/fixtures/function.generate.yml
|
226
227
|
- spec/fixtures/get.generate.yml
|
227
228
|
- spec/fixtures/heredoc.generate.yml
|
229
|
+
- spec/fixtures/inline.generate.yml
|
228
230
|
- spec/fixtures/literals.generate.yml
|
229
231
|
- spec/fixtures/loop.generate.yml
|
230
232
|
- spec/fixtures/main.compile.yml
|