Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CB839DCF3 for ; Mon, 18 Feb 2013 11:16:52 +0000 (UTC) Received: (qmail 66355 invoked by uid 500); 18 Feb 2013 11:16:52 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 66304 invoked by uid 500); 18 Feb 2013 11:16:52 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 66268 invoked by uid 99); 18 Feb 2013 11:16:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Feb 2013 11:16:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Feb 2013 11:16:49 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E2A8023888CD; Mon, 18 Feb 2013 11:16:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1447198 - in /flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler: as/codegen/ASTokens.java internal/as/codegen/ASEmitter.java Date: Mon, 18 Feb 2013 11:16:30 -0000 To: commits@flex.apache.org From: mschmalle@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130218111630.E2A8023888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mschmalle Date: Mon Feb 18 11:16:30 2013 New Revision: 1447198 URL: http://svn.apache.org/r1447198 Log: Flex:FalconJx - remove a couple junk methods from ASEmitter and added a stringifyNode method Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/as/codegen/ASTokens.java flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/as/codegen/ASTokens.java URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/as/codegen/ASTokens.java?rev=1447198&r1=1447197&r2=1447198&view=diff ============================================================================== --- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/as/codegen/ASTokens.java (original) +++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/as/codegen/ASTokens.java Mon Feb 18 11:16:30 2013 @@ -40,13 +40,19 @@ public interface ASTokens public static final String BRACE_CLOSE = "}"; public static final String COLON = ":"; - + + public static final String SEMICOLON = ";"; + public static final String COMMA = ","; public static final String FUNCTION = "function"; public static final String EQUAL = "="; + public static final String FOR = "for"; + + public static final String THIS = "this"; + // int EOF = 1; // int NULL_TREE_LOOKAHEAD = 3; // int HIDDEN_TOKEN_COMMENT = 4; Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java?rev=1447198&r1=1447197&r2=1447198&view=diff ============================================================================== --- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java (original) +++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java Mon Feb 18 11:16:30 2013 @@ -269,7 +269,7 @@ public class ASEmitter implements IASEmi { write(value); } - + @Override public void writeToken(String value) { @@ -1455,33 +1455,23 @@ public class ASEmitter implements IASEmi { } - //-------------------------------------------------------------------------- - // TODO (mschmalle) These are here to remind me I did the newline push backwards, needs to be fixed - //-------------------------------------------------------------------------- - - protected void loopIndent(int i, int len, boolean hasIndent) - { - if (i < len - 1) - { - writeNewline(); - } - else - { - if (hasIndent) - indentPop(); - writeNewline(); - } - } - - protected boolean maybeIndent(int len) + /** + * Takes the node argument and created a String representation if it using + * the buffer temporarily. + *

+ * Note; This method is still beta, it need more logic if an emitter is + * actually using the buffer! + * + * @param node The node walk and create a String for. + * @return The node's output. + */ + protected String stringifyNode(IASNode node) { - if (len > 0 && getCurrentIndent() == 0) - { - indentPush(); - write(getIndent(getCurrentIndent())); - return true; - } - return false; + setBufferWrite(true); + getWalker().walk(node); + String result = getBuilder().toString(); + getBuilder().setLength(0); + setBufferWrite(false); + return result; } - }