ClassDefinition GetClassDefinition(string code) { RubyParser parser = new RubyParser(); SourceUnitTree unit = parser.CreateAst(@"test.rb", new StringTextBuffer(code)); return(unit.Statements.First as ClassDefinition); }
static Statements Parse(string code) { RubyParser parser = new RubyParser(); SourceUnitTree unit = parser.CreateAst(@"snippet.rb", new StringTextBuffer(code)); return(unit.Statements); }