Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

metaprogramming the valueboxdcl node

  • Loading branch information...
commit e48ffde5b7ff4fa375fcdb3a90c7166463244a86 1 parent 2eaff8a
Aaron Patterson authored
2  lib/yacc.y
View
@@ -230,7 +230,7 @@ value_forward_dcl
/*15*/
value_box_dcl
: T_VALUETYPE T_IDENTIFIER type_spec {
- result = ValueBoxDcl.new(val[1], val[2])
+ result = ValueBoxDcl.new(val[2], :name => val[1])
}
;
1  lib/zomg.rb
View
@@ -20,7 +20,6 @@
scoped_name
constant
binary
- value_box_dcl
}.each { |node_type|
require "zomg/idl/nodes/#{node_type}"
}
2  lib/zomg/idl/nodes/node.rb
View
@@ -38,7 +38,7 @@ def to_ruby
UnsignedLongLong LongLong Any ForwardDeclaration WChar
FloatingPointLiteral BooleanLiteral Context StringLiteral
WideStringLiteral WideCharacterLiteral UnaryMinus Object
- UnaryPlus WString String Case Enum Exception
+ UnaryPlus WString String Case Enum Exception ValueBoxDcl
}.each { |type| const_set(type.to_sym, Class.new(Node)) }
end
end
13 lib/zomg/idl/nodes/value_box_dcl.rb
View
@@ -1,13 +0,0 @@
-module ZOMG
- module IDL
- module Nodes
- class ValueBoxDcl < Node
- attr_accessor :name
- def initialize(name, children)
- @name = name
- super(children)
- end
- end
- end
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.