Package org.jruby.ast

Examples of org.jruby.ast.DSymbolNode


                };
        context.createNewString(dstrCallback, dstrNode.size());
    }

    public void compileDSymbol(Node node, BodyCompiler context) {
        final DSymbolNode dsymbolNode = (DSymbolNode) node;

        ArrayCallback dstrCallback = new ArrayCallback() {

                    public void nextValue(BodyCompiler context, Object sourceArray,
                            int index) {
                        compile(dsymbolNode.get(index), context);
                    }
                };
        context.createNewSymbol(dstrCallback, dsymbolNode.size());
    }
View Full Code Here


                   if (((Node)yyVals[-1+yyTop]) == null) {
                       yyerror("empty symbol literal");
                   }

       if (((Node)yyVals[-1+yyTop]) instanceof DStrNode) {
           yyVal = new DSymbolNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((DStrNode)yyVals[-1+yyTop]));
       } else {
                       ISourcePosition position = support.union(((Node)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop]));

                       /* We substract one since tsymbeg is longer than one*/
           /* and we cannot union it directly so we assume quote*/
                       /* is one character long and subtract for it.*/
           position.adjustStartOffset(-1);
                       ((Node)yyVals[-1+yyTop]).setPosition(position);
          
           yyVal = new DSymbolNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
                       ((DSymbolNode)yyVal).add(((Node)yyVals[-1+yyTop]));
                   }
         }
  break;
case 408:
View Full Code Here

            }
        }
    }

    public void compileDSymbol(Node node, BodyCompiler context, boolean expr) {
        final DSymbolNode dsymbolNode = (DSymbolNode) node;

        ArrayCallback dstrCallback = new ArrayCallback() {

                    public void nextValue(BodyCompiler context, Object sourceArray,
                            int index) {
                        compile(dsymbolNode.get(index), context, true);
                    }
                };

        if (expr) {
            context.createNewSymbol(dstrCallback, dsymbolNode.size());
        } else {
            // not an expression, only compile the elements
            for (Node nextNode : dsymbolNode.childNodes()) {
                compile(nextNode, context, false);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.jruby.ast.DSymbolNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.