Ejemplo n.º 1
0
        ClassDefinition GetClassDefinition(string code)
        {
            RubyParser     parser = new RubyParser();
            SourceUnitTree unit   = parser.CreateAst(@"test.rb", new StringTextBuffer(code));

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

            return(unit.Statements);
        }