rblade 0.2.0 → 0.2.2
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aef0eb02d400c2a6af0c114d0952d9871cb83866fa6fbdf43d72eddd555344c2
|
4
|
+
data.tar.gz: 72c5ae0785f172248afd031acd15f3608f6f7cb2e313fcfeeaaa432dcf5bc344
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0425f57b22af0ced7dbe28fe25a88da21d5d5cfd4960ebb22a6fd6b53108cb9af6eb2e01b31e9fae919478cc38ddca9bffe23f05439e58f3f4dbb2665ee39fa2
|
7
|
+
data.tar.gz: 64c90f0edddc6b534f1104240788bb8fe7afc7dd78a06ca037d24228b5127746380d41fabb7473c827c7327abe26362c97a8ad5e2090393b68887061e0d3fbad
|
data/CHANGELOG.md
CHANGED
@@ -39,6 +39,9 @@ module RBlade
|
|
39
39
|
|
40
40
|
def compile_token_end token
|
41
41
|
component = @component_stack.pop
|
42
|
+
if component.nil?
|
43
|
+
raise StandardError.new "Unexpected closing tag (#{token.value[:name]})"
|
44
|
+
end
|
42
45
|
if token.value[:name] != component[:name]
|
43
46
|
raise StandardError.new "Unexpected closing tag (#{token.value[:name]}) expecting #{component[:name]}"
|
44
47
|
end
|
@@ -73,6 +76,12 @@ module RBlade
|
|
73
76
|
|
74
77
|
next
|
75
78
|
end
|
79
|
+
if attribute[:type] == "attributes"
|
80
|
+
attribute_arguments.push "**attributes.to_h"
|
81
|
+
attribute_assignments.push "_style = attributes[:style];"
|
82
|
+
|
83
|
+
next
|
84
|
+
end
|
76
85
|
|
77
86
|
if attribute[:type] == "string"
|
78
87
|
attribute_arguments.push "'#{attribute[:name]}': '#{RBlade.escape_quotes(attribute[:value])}'"
|
@@ -57,9 +57,9 @@ module RBlade
|
|
57
57
|
if name == "@class" || name == "@style"
|
58
58
|
attributes.push({type: name[1..], value: raw_attributes[i + 1][1..-2]})
|
59
59
|
i += 2
|
60
|
-
elsif name
|
61
|
-
attributes.push({type: "attributes", value: raw_attributes[i + 1]
|
62
|
-
i +=
|
60
|
+
elsif name == "{{"
|
61
|
+
attributes.push({type: "attributes", value: raw_attributes[i + 1]})
|
62
|
+
i += 3
|
63
63
|
else
|
64
64
|
attribute = {name:}
|
65
65
|
|
@@ -116,7 +116,7 @@ module RBlade
|
|
116
116
|
)
|
117
117
|
|
|
118
118
|
(
|
119
|
-
\{\{\s*attributes
|
119
|
+
\{\{\s*attributes.*?\s*\}\}
|
120
120
|
)
|
121
121
|
|
|
122
122
|
(?:
|
@@ -163,7 +163,7 @@ module RBlade
|
|
163
163
|
)
|
164
164
|
|
|
165
165
|
(?:
|
166
|
-
(\{\{)\s*attributes
|
166
|
+
(\{\{)\s*(attributes.*?)\s*(\}\})
|
167
167
|
)
|
168
168
|
|
|
169
169
|
(?:
|
data/lib/rblade/compiler.rb
CHANGED
@@ -23,10 +23,10 @@ module RBlade
|
|
23
23
|
tokens = [Token.new(:unprocessed, string_template)]
|
24
24
|
|
25
25
|
CompilesComments.new.compile! tokens
|
26
|
-
CompilesEchos.new.compile! tokens
|
27
26
|
CompilesRuby.new.compile! tokens
|
28
27
|
TokenizesComponents.new.tokenize! tokens
|
29
28
|
TokenizesStatements.new.tokenize! tokens
|
29
|
+
CompilesEchos.new.compile! tokens
|
30
30
|
CompilesStatements.new.compile! tokens
|
31
31
|
CompilesComponents.new.compile! tokens
|
32
32
|
|
data/rblade.gemspec
CHANGED