sfp 0.3.22 → 0.4.1
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/VERSION +1 -1
- data/lib/sfp/SfpLangLexer.rb +51 -51
- data/lib/sfp/SfpLangParser.rb +394 -390
- data/src/SfpLang.g +13 -9
- metadata +2 -2
data/src/SfpLang.g
CHANGED
@@ -202,15 +202,19 @@ object_def returns [id]
|
|
202
202
|
('extends' path
|
203
203
|
{
|
204
204
|
template = @root.at?($path.text)
|
205
|
-
|
206
|
-
template.
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
@now[$ID.text]
|
213
|
-
|
205
|
+
if template.is_a?(Sfp::Unknown) or template.is_a?(Sfp::Undefined)
|
206
|
+
raise Exception, "Object template #{$path.text} is not found!"
|
207
|
+
end
|
208
|
+
if !template.is_a?(Hash) or (template['_context'] != 'object' and template['_context'] != 'abstract')
|
209
|
+
puts template['_context']
|
210
|
+
raise Exception, "#{$path.text}:[#{template['_context']}] is not an object or an abstract object!"
|
211
|
+
end
|
212
|
+
object = @now[$ID.text] = Sfp::Helper.deep_clone(template)
|
213
|
+
object.accept(Sfp::Visitor::ParentEliminator.new)
|
214
|
+
object['_parent'] = @now
|
215
|
+
object['_self'] = $ID.text
|
216
|
+
object['_context'] = 'object'
|
217
|
+
object.accept(Sfp::Visitor::SfpGenerator.new(@root))
|
214
218
|
@use_template = true
|
215
219
|
}
|
216
220
|
)?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sfp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Herry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: antlr3
|