diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SimpleLanguage.atg @ 16687:7c8ddb4233cd

SL/SourceAttribution: restore some attribution fixes that were lost in a tussle with hg; turn off tracing code in SL tests.
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Mon, 04 Aug 2014 18:53:21 -0700
parents 888907296590
children f444ef4684ec
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SimpleLanguage.atg	Fri Aug 01 18:24:22 2014 -0700
+++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SimpleLanguage.atg	Mon Aug 04 18:53:21 2014 -0700
@@ -65,9 +65,10 @@
 
 Function
 =
-"function"                                      
-identifier                                      (. factory.startFunction(t); .)
-"("
+"function"
+identifier            							(. Token identifierToken = t; .)                          
+"("												(. int bodyStartPos = t.charPos; .)
+												(. factory.startFunction(identifierToken, bodyStartPos); .)
 [
     identifier                                  (. factory.addFormalParameter(t); .)
     {
@@ -125,8 +126,8 @@
 
 IfStatement<out SLStatementNode result, boolean inLoop>
 =
-"if" 
-"("                                             (. Token ifToken = t; .)
+"if" 											(. Token ifToken = t; .)
+"("
 Expression<out SLExpressionNode condition> 
 ")"
 Block<out SLStatementNode thenPart, inLoop>     (. SLStatementNode elsePart = null; .)