Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SimpleLanguage.atg @ 16684:d654cd5ed05a
SL/SourceAttribution: further corrections for attributing function bodies
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Fri, 01 Aug 2014 18:10:48 -0700 |
parents | 0fc43b066eee |
children | 888907296590 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SimpleLanguage.atg Fri Aug 01 16:30:22 2014 -0700 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SimpleLanguage.atg Fri Aug 01 18:10:48 2014 -0700 @@ -66,8 +66,9 @@ Function = "function" -identifier (. factory.startFunction(t); .) -"(" +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; .)