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.
@@ -202,15 +202,19 @@ object_def returns [id]
202
202
  ('extends' path
203
203
  {
204
204
  template = @root.at?($path.text)
205
- raise Exception, "Object template #{$path.text} is not found!" if
206
- template.is_a?(Sfp::Unknown) or template.is_a?(Sfp::Undefined)
207
- raise Exception, "#{$path.text} is not an object!" if
208
- !template.is_a?(Hash) or template['_context'] != 'object'
209
- @now[$ID.text] = Sfp::Helper.deep_clone(template)
210
- @now[$ID.text].accept(Sfp::Visitor::ParentEliminator.new)
211
- @now[$ID.text]['_parent'] = @now
212
- @now[$ID.text]['_self'] = $ID.text
213
- @now[$ID.text].accept(Sfp::Visitor::SfpGenerator.new(@root))
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.3.22
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-16 00:00:00.000000000 Z
11
+ date: 2013-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: antlr3