Skip to content

C.parse() keeps internal state #6

@ghazel

Description

@ghazel

C.parse seems to keep state somewhere, which breaks the ability to parse more than once;

1.9.3p286 :001 > require 'cast'
 => true 
1.9.3p286 :002 > C.parse("typedef int fun;")
 => TranslationUnit
    entities: 
        - Declaration
            storage: typedef
            type: Int
            declarators: 
                - Declarator
                    name: "fun"

1.9.3p286 :003 > C.parse("typedef int fun;")
C::ParseError: 1:0: invalid type specifier combination: int fun
    from c.y:593:in `parse'
    from cast-0.2.1/lib/cast/parse.rb:57:in `parse'
    from cast-0.2.1/lib/cast/parse.rb:51:in `parse'
    from (irb):3
    from ruby-1.9.3-p286/bin/irb:16:in `<main>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions