# HG changeset patch # User Aziz K?ksal # Date 1200697857 -3600 # Node ID 95a3c28c0f648959fcb8334609ebab5238c254f4 # Parent 6b3e397229c509edf5d40dcb4550535be3e74fdd Renamed AsmStatement->AsmBlockStatement and AsnInstruction->AsmStatement. diff -r 6b3e397229c5 -r 95a3c28c0f64 trunk/src/cmd/Generate.d --- a/trunk/src/cmd/Generate.d Fri Jan 18 23:59:41 2008 +0100 +++ b/trunk/src/cmd/Generate.d Sat Jan 19 00:10:57 2008 +0100 @@ -104,9 +104,7 @@ { case NodeKind.CatchBody, NodeKind.FinallyBody, - NodeKind.FunctionBody, - NodeKind.AsmInstruction, - NodeKind.IllegalAsmInstruction: + NodeKind.FunctionBody: break; default: suffixLength = "Statement".length; diff -r 6b3e397229c5 -r 95a3c28c0f64 trunk/src/dil/Messages.d --- a/trunk/src/dil/Messages.d Fri Jan 18 23:59:41 2008 +0100 +++ b/trunk/src/dil/Messages.d Sat Jan 19 00:10:57 2008 +0100 @@ -105,7 +105,7 @@ auto StringPostfixMismatch = "string literal has mistmatching postfix character"; auto ExpectedIdAfterTypeDot = "expected identifier after '(Type).', not '{}'"; auto ExpectedModuleIdentifier = "expected module identifier, not '{}'"; - auto IllegalDeclaration = "illegal Declaration found: {}"; + auto IllegalDeclaration = "illegal declaration found: {}"; auto ExpectedFunctionName = "expected function name, not '{}'"; auto ExpectedVariableName = "expected variable name, not '{}'"; auto ExpectedFunctionBody = "expected function body, not '{}'"; @@ -124,12 +124,12 @@ auto ExpectedUnionBody = "expected union body, not '{}'"; auto ExpectedTemplateName = "expected template name, not '{}'"; auto ExpectedAnIdentifier = "expected an identifier, not '{}'"; - auto IllegalStatement = "illegal Statement found: {}"; + auto IllegalStatement = "illegal statement found: {}"; auto ExpectedNonEmptyStatement = "didn't expect ';', use {{ } instead"; auto ExpectedScopeIdentifier = "expected 'exit', 'success' or 'failure', not '{}'"; auto InvalidScopeIdentifier = "'exit', 'success', 'failure' are valid scope identifiers, but not '{}'"; auto ExpectedIntegerAfterAlign = "expected an integer after align, not '{}'"; - auto IllegalAsmInstruction = "illegal AsmInstruction found: {}"; + auto IllegalAsmStatement = "illegal asm statement found: {}"; auto ExpectedDeclaratorIdentifier = "expected declarator identifier, not '{}'"; auto ExpectedTemplateParameters = "expected one or more template parameters, not ')'"; auto ExpectedTypeOrExpression = "expected a type or and expression, not ')'"; diff -r 6b3e397229c5 -r 95a3c28c0f64 trunk/src/dil/ast/DefaultVisitor.d --- a/trunk/src/dil/ast/DefaultVisitor.d Fri Jan 18 23:59:41 2008 +0100 +++ b/trunk/src/dil/ast/DefaultVisitor.d Sat Jan 19 00:10:57 2008 +0100 @@ -263,9 +263,9 @@ visitE(s.e); static if (is(S == VolatileStatement)) s.volatileBody && visitS(s.volatileBody); - static if (is(S == AsmStatement)) + static if (is(S == AsmBlockStatement)) visitS(s.statements); - static if (is(S == AsmInstruction)) + static if (is(S == AsmStatement)) foreach (op; s.operands) visitE(op); //AsmAlignStatement has no subnodes. diff -r 6b3e397229c5 -r 95a3c28c0f64 trunk/src/dil/ast/NodesEnum.d --- a/trunk/src/dil/ast/NodesEnum.d Fri Jan 18 23:59:41 2008 +0100 +++ b/trunk/src/dil/ast/NodesEnum.d Sat Jan 19 00:10:57 2008 +0100 @@ -82,10 +82,10 @@ "ScopeGuardStatement", "ThrowStatement", "VolatileStatement", + "AsmBlockStatement", "AsmStatement", - "AsmInstruction", "AsmAlignStatement", - "IllegalAsmInstruction", + "IllegalAsmStatement", "PragmaStatement", "MixinStatement", "StaticIfStatement", diff -r 6b3e397229c5 -r 95a3c28c0f64 trunk/src/dil/ast/Statements.d --- a/trunk/src/dil/ast/Statements.d Fri Jan 18 23:59:41 2008 +0100 +++ b/trunk/src/dil/ast/Statements.d Sat Jan 19 00:10:57 2008 +0100 @@ -416,7 +416,7 @@ } } -class AsmStatement : Statement +class AsmBlockStatement : Statement { CompoundStatement statements; this(CompoundStatement statements) @@ -427,7 +427,7 @@ } } -class AsmInstruction : Statement +class AsmStatement : Statement { Identifier* ident; Expression[] operands; @@ -450,7 +450,7 @@ } } -class IllegalAsmInstruction : IllegalStatement +class IllegalAsmStatement : IllegalStatement { this() { diff -r 6b3e397229c5 -r 95a3c28c0f64 trunk/src/dil/lexer/Token.d --- a/trunk/src/dil/lexer/Token.d Fri Jan 18 23:59:41 2008 +0100 +++ b/trunk/src/dil/lexer/Token.d Sat Jan 19 00:10:57 2008 +0100 @@ -181,10 +181,10 @@ return isStatementStartToken(kind); } - /// Returns true if this token starts an AsmInstruction. - bool isAsmInstructionStart() + /// Returns true if this token starts an AsmStatement. + bool isAsmStatementStart() { - return isAsmInstructionStartToken(kind); + return isAsmStatementStartToken(kind); } int opEquals(TOK kind2) @@ -315,7 +315,7 @@ } } -/// Stores data about newlines. +/// Data associated with newline tokens. struct NewlineData { struct FilePaths @@ -376,8 +376,8 @@ return false; } -/// Returns true if this token starts an AsmInstruction. -bool isAsmInstructionStartToken(TOK tok) +/// Returns true if this token starts an AsmStatement. +bool isAsmStatementStartToken(TOK tok) { switch(tok) { diff -r 6b3e397229c5 -r 95a3c28c0f64 trunk/src/dil/parser/Parser.d --- a/trunk/src/dil/parser/Parser.d Fri Jan 18 23:59:41 2008 +0100 +++ b/trunk/src/dil/parser/Parser.d Sat Jan 19 00:10:57 2008 +0100 @@ -1554,7 +1554,7 @@ s = parseVolatileStatement(); break; case T.Asm: - s = parseAsmStatement(); + s = parseAsmBlockStatement(); break; case T.Pragma: s = parsePragmaStatement(); @@ -2270,19 +2270,19 @@ + Assembler parsing methods + +++++++++++++++++++++++++++++/ - Statement parseAsmStatement() + Statement parseAsmBlockStatement() { assert(token.kind == T.Asm); nT(); // Skip asm keyword. require(T.LBrace); auto ss = new CompoundStatement; while (token.kind != T.RBrace && token.kind != T.EOF) - ss ~= parseAsmInstruction(); + ss ~= parseAsmStatement(); require(T.RBrace); - return new AsmStatement(ss); + return new AsmBlockStatement(ss); } - Statement parseAsmInstruction() + Statement parseAsmStatement() { auto begin = token; Statement s; @@ -2299,8 +2299,8 @@ nT(); // Skip Identifier if (skipped(T.Colon)) { - // Identifier : AsmInstruction - s = new LabeledStatement(ident, parseAsmInstruction()); + // Identifier : AsmStatement + s = new LabeledStatement(ident, parseAsmStatement()); break; } @@ -2315,7 +2315,7 @@ es ~= parseAsmExpression(); while (skipped(T.Comma)) require(T.Semicolon); - s = new AsmInstruction(ident, es); + s = new AsmStatement(ident, es); break; case T.Align: // align Integer; @@ -2333,15 +2333,15 @@ nT(); break; default: - s = new IllegalAsmInstruction(); + s = new IllegalAsmStatement(); // Skip to next valid token. do nT(); - while (!token.isAsmInstructionStart && + while (!token.isAsmStatementStart && token.kind != T.RBrace && token.kind != T.EOF) auto text = Token.textSpan(begin, this.prevToken); - error(begin, MSG.IllegalAsmInstruction, text); + error(begin, MSG.IllegalAsmStatement, text); } set(s, begin); return s;