コード例 #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);
        }
コード例 #2
0
        static Statements Parse(string code)
        {
            RubyParser     parser = new RubyParser();
            SourceUnitTree unit   = parser.CreateAst(@"snippet.rb", new StringTextBuffer(code));

            return(unit.Statements);
        }