liquidscript 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/liquidscript/compiler/icr/functions.rb +1 -7
- data/lib/liquidscript/compiler/icr/literals.rb +2 -1
- data/lib/liquidscript/errors.rb +2 -1
- data/lib/liquidscript/generator/javascript/objects.rb +1 -1
- data/lib/liquidscript/version.rb +1 -1
- data/spec/fixtures/class.compile.yml +3 -2
- data/spec/fixtures/class.generate.yml +3 -3
- data/spec/fixtures/combination.generate.yml +3 -3
- data/spec/fixtures/main.compile.yml +6 -2
- data/spec/support/matchers/compile.rb +1 -1
- data/spec/support/matchers/generate.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: fd125951854295e502bad68f06358e1546554d70
|
4
|
+
data.tar.gz: ca1ddecbcbaff2e1f54689eb4482f56f8ff0c147
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9efea19e05234c3eefedfdd374884e6df84f105ee0831fbf18d0f2a90eea32cf027e6d6e83ef4693c2656303666f52ebf6cad053219c822bc45423620a9fb478
|
7
|
+
data.tar.gz: c1ba8350f0ce9db207aaac1fd08456d1142c57c964e7ef11c13c956c30ef5d07fff53a984b7d1aecef4e16da5892c70c3dcb34373559224c440c02300faf5a64
|
@@ -6,14 +6,8 @@ module Liquidscript
|
|
6
6
|
def compile_property(prop)
|
7
7
|
shift :prop
|
8
8
|
|
9
|
-
ref = if [:identifier, :class, :module].include?(prop.type)
|
10
|
-
ref(prop)
|
11
|
-
else
|
12
|
-
prop
|
13
|
-
end
|
14
|
-
|
15
9
|
property = action do |ident|
|
16
|
-
code :property,
|
10
|
+
code :property, prop, ident
|
17
11
|
end
|
18
12
|
|
19
13
|
# Just in case there is a property named 'class' or 'module'
|
data/lib/liquidscript/errors.rb
CHANGED
@@ -3,7 +3,7 @@ module Liquidscript
|
|
3
3
|
class Error < ::StandardError; end
|
4
4
|
|
5
5
|
class SyntaxError < Error; end
|
6
|
-
class CompileError < Error;
|
6
|
+
class CompileError < Error; end
|
7
7
|
class GeneratorError < Error; end
|
8
8
|
|
9
9
|
class UnexpectedEndError < CompileError; end
|
@@ -13,6 +13,7 @@ module Liquidscript
|
|
13
13
|
super "No variable named #{name}"
|
14
14
|
end
|
15
15
|
end
|
16
|
+
|
16
17
|
class UnexpectedError < CompileError
|
17
18
|
def initialize(expected, got)
|
18
19
|
@expected = expected
|
data/lib/liquidscript/version.rb
CHANGED
@@ -12,10 +12,10 @@ data: |
|
|
12
12
|
}
|
13
13
|
|
14
14
|
compiled: |
|
15
|
-
var
|
15
|
+
var Something, Test;
|
16
16
|
|
17
|
-
Something = {};
|
18
|
-
Test = function Test() {
|
17
|
+
Something = Something || {};
|
18
|
+
Test = Test || function Test() {
|
19
19
|
if(this.initialize) {
|
20
20
|
this.initialize.apply(this, arguments);
|
21
21
|
}
|
@@ -14,10 +14,10 @@ data: |
|
|
14
14
|
}
|
15
15
|
|
16
16
|
compiled: |
|
17
|
-
var Test,
|
17
|
+
var Test, SomeModule, Thing;
|
18
18
|
Test = require("some_module/test");
|
19
|
-
SomeModule = {};
|
20
|
-
Thing = function Thing() {
|
19
|
+
SomeModule = SomeModule || {};
|
20
|
+
Thing = Thing || function Thing() {
|
21
21
|
if(this.initialize) {
|
22
22
|
this.initialize.apply(this, arguments);
|
23
23
|
}
|
@@ -13,6 +13,7 @@ compiled:
|
|
13
13
|
- :console
|
14
14
|
- - :number
|
15
15
|
- "2"
|
16
|
+
- - :newline
|
16
17
|
- - :set
|
17
18
|
- - :_variable
|
18
19
|
- :func
|
@@ -22,11 +23,14 @@ compiled:
|
|
22
23
|
- []
|
23
24
|
- - :_arguments
|
24
25
|
- []
|
26
|
+
- - :newline
|
25
27
|
- - :call
|
26
28
|
- - :property
|
27
|
-
- - :
|
28
|
-
-
|
29
|
+
- - :identifier
|
30
|
+
- console
|
29
31
|
- - :identifier
|
30
32
|
- log
|
31
33
|
- - :dstring
|
32
34
|
- hello world
|
35
|
+
- - :newline
|
36
|
+
- - :newline
|