liquidscript 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/liquidscript/compiler/icr/expressions.rb +1 -7
- data/lib/liquidscript/compiler/icr/functions.rb +12 -4
- data/lib/liquidscript/compiler/icr/literals.rb +3 -4
- data/lib/liquidscript/template.rb +1 -1
- data/lib/liquidscript/version.rb +1 -1
- data/spec/fixtures/main.compile.yml +2 -3
- data/spec/fixtures/string.compile.yml +2 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f8c6c51fffb0d24bf827a356b8cf8c46e2bed25
|
4
|
+
data.tar.gz: e67a07ac9bbf1d249dde0b499d334b1084d6fd15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 629068c68ffea87eaa555918f770424272be615355651c0e19c81113f6416136d288a99f6ef2c24fb6485e75821a613913437d6c0997f0477787794cb63e2535
|
7
|
+
data.tar.gz: dba22b9effe63127631a2687961bdb8d4c8b46051430e152bd680eabe573d2c131a4f44bd78a41258a503abcab3445877948e519ea4ada251909f0098e3b6a4a
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ module Liquidscript
|
|
13
13
|
# Just in case there is a property named 'class' or 'module'
|
14
14
|
v = expect [:identifier, :class, :module] => property
|
15
15
|
|
16
|
-
|
16
|
+
v
|
17
17
|
end
|
18
18
|
|
19
19
|
def compile_access(body)
|
@@ -23,7 +23,7 @@ module Liquidscript
|
|
23
23
|
|
24
24
|
v = code :access, body, key
|
25
25
|
|
26
|
-
|
26
|
+
v
|
27
27
|
end
|
28
28
|
|
29
29
|
def compile_call(subject)
|
@@ -36,13 +36,15 @@ module Liquidscript
|
|
36
36
|
arguments = collect_compiles :expression, :rparen,
|
37
37
|
:comma => action.shift
|
38
38
|
|
39
|
-
code :call, subject, *arguments
|
39
|
+
call = code :call, subject, *arguments
|
40
|
+
call
|
40
41
|
end
|
41
42
|
|
42
43
|
protected
|
43
44
|
|
44
45
|
def value_expect(v, &default)
|
45
|
-
|
46
|
+
out = expect \
|
47
|
+
:lparen => action { compile_call(v) },
|
46
48
|
:equal => action { compile_assignment(v) },
|
47
49
|
:prop => action { compile_property(v) },
|
48
50
|
:lbrack => action { compile_access(v) },
|
@@ -51,6 +53,12 @@ module Liquidscript
|
|
51
53
|
:plus] => action { compile_binop(v) },
|
52
54
|
:unop => action { |o| code :op, v, o },
|
53
55
|
:_ => default || action { v }
|
56
|
+
|
57
|
+
if out != v
|
58
|
+
value_expect(out)
|
59
|
+
else
|
60
|
+
out
|
61
|
+
end
|
54
62
|
end
|
55
63
|
end
|
56
64
|
end
|
@@ -52,6 +52,7 @@ module Liquidscript
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def _compile_for_seg(first)
|
55
|
+
first = value_expect(first)
|
55
56
|
shift :comma
|
56
57
|
second = compile_vexpression
|
57
58
|
shift :comma
|
@@ -64,11 +65,9 @@ module Liquidscript
|
|
64
65
|
end
|
65
66
|
|
66
67
|
def compile_identifier(identifier)
|
67
|
-
|
68
|
-
code :get, ref(identifier)
|
69
|
-
end
|
68
|
+
ref(identifier) unless peek?(:equal)
|
70
69
|
|
71
|
-
|
70
|
+
identifier
|
72
71
|
end
|
73
72
|
|
74
73
|
def compile_regex
|
@@ -9,7 +9,7 @@ module Liquidscript
|
|
9
9
|
|
10
10
|
def render
|
11
11
|
@_render ||= begin
|
12
|
-
compiler = Compiler::ICR.new(
|
12
|
+
compiler = Compiler::ICR.new(Scanner::Liquidscript.new(@data))
|
13
13
|
compiler.compile
|
14
14
|
Generator::Javascript.new(compiler.top).generate
|
15
15
|
end
|
data/lib/liquidscript/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liquidscript
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Rodi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|