Permalink
Browse files

metaprogramming the exception node

  • Loading branch information...
1 parent cef1fa8 commit 2eaff8a6316c6485761dff770252fffc347c1ad5 @tenderlove committed Aug 13, 2008
Showing with 2 additions and 16 deletions.
  1. +1 −1 lib/yacc.y
  2. +0 −1 lib/zomg.rb
  3. +0 −13 lib/zomg/idl/nodes/exception.rb
  4. +1 −1 lib/zomg/idl/nodes/node.rb
View
@@ -747,7 +747,7 @@ simple_declarators
/*86*/
except_dcl
: T_EXCEPTION T_IDENTIFIER T_LEFT_CURLY_BRACKET members
- T_RIGHT_CURLY_BRACKET { result = Exception.new(val[1], val[3]) }
+ T_RIGHT_CURLY_BRACKET { result = Exception.new(val[3], :name => val[1]) }
;
members
View
@@ -9,7 +9,6 @@
interface
operation
parameter
- exception
attribute
struct
simple_declarator
@@ -1,13 +0,0 @@
-module ZOMG
- module IDL
- module Nodes
- class Exception < Node
- attr_accessor :name
- def initialize(name, members)
- super(members)
- @name = name
- end
- end
- end
- end
-end
@@ -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
+ UnaryPlus WString String Case Enum Exception
}.each { |type| const_set(type.to_sym, Class.new(Node)) }
end
end

0 comments on commit 2eaff8a

Please sign in to comment.