Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/Parser.java @ 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 |
comparison
equal
deleted
inserted
replaced
16675:0fc43b066eee | 16684:d654cd5ed05a |
---|---|
132 } | 132 } |
133 | 133 |
134 void Function() { | 134 void Function() { |
135 Expect(4); | 135 Expect(4); |
136 Expect(1); | 136 Expect(1); |
137 factory.startFunction(t); | 137 Token identifierToken = t; |
138 Expect(5); | 138 Expect(5); |
139 int bodyStartPos = t.charPos; | |
140 factory.startFunction(identifierToken, bodyStartPos); | |
139 if (la.kind == 1) { | 141 if (la.kind == 1) { |
140 Get(); | 142 Get(); |
141 factory.addFormalParameter(t); | 143 factory.addFormalParameter(t); |
142 while (la.kind == 6) { | 144 while (la.kind == 6) { |
143 Get(); | 145 Get(); |
217 } | 219 } |
218 | 220 |
219 SLStatementNode IfStatement(boolean inLoop) { | 221 SLStatementNode IfStatement(boolean inLoop) { |
220 SLStatementNode result; | 222 SLStatementNode result; |
221 Expect(14); | 223 Expect(14); |
224 Token ifToken = t; | |
222 Expect(5); | 225 Expect(5); |
223 Token ifToken = t; | |
224 SLExpressionNode condition = Expression(); | 226 SLExpressionNode condition = Expression(); |
225 Expect(7); | 227 Expect(7); |
226 SLStatementNode thenPart = Block(inLoop); | 228 SLStatementNode thenPart = Block(inLoop); |
227 SLStatementNode elsePart = null; | 229 SLStatementNode elsePart = null; |
228 if (la.kind == 15) { | 230 if (la.kind == 15) { |