Method: Crokus::Parser#parse_struct
- Defined in:
- lib/crokus/parser.rb
#parse_struct ⇒ Object
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/crokus/parser.rb', line 173 def parse_struct indent "struct" expect :struct name=nil if showNext.is? :ident name=acceptIt end ret=Struct.new(name) if showNext.is? :lbrace acceptIt while !showNext.is? :rbrace ret.decls << declaration() end ret.decls.flatten! expect :rbrace end dedent return ret end |