comparison truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SLNodeFactory.java @ 22251:8dddde8b20d4

Truffle/SL: provide an "unavailable" SourceSection for every RootNode, using a newly defined static name that identifies "SL Builtin" RootNodes.
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Thu, 24 Sep 2015 13:16:52 -0700
parents dc83cc1f94f2
children 1348cc2e084e
comparison
equal deleted inserted replaced
22250:0fb3522e5b72 22251:8dddde8b20d4
164 final SourceSection functionSrc = source.createSection(functionName, functionStartPos, bodyEndPos - functionStartPos); 164 final SourceSection functionSrc = source.createSection(functionName, functionStartPos, bodyEndPos - functionStartPos);
165 final SLStatementNode methodBlock = finishBlock(methodNodes, functionBodyStartPos, bodyEndPos - functionBodyStartPos); 165 final SLStatementNode methodBlock = finishBlock(methodNodes, functionBodyStartPos, bodyEndPos - functionBodyStartPos);
166 assert lexicalScope == null : "Wrong scoping of blocks in parser"; 166 assert lexicalScope == null : "Wrong scoping of blocks in parser";
167 167
168 final SLFunctionBodyNode functionBodyNode = new SLFunctionBodyNode(functionSrc, methodBlock); 168 final SLFunctionBodyNode functionBodyNode = new SLFunctionBodyNode(functionSrc, methodBlock);
169 final SLRootNode rootNode = new SLRootNode(this.context, frameDescriptor, functionBodyNode, functionName); 169 final SLRootNode rootNode = new SLRootNode(this.context, frameDescriptor, functionBodyNode, functionSrc, functionName);
170 rootNode.assignSourceSection(functionSrc);
171 170
172 context.getFunctionRegistry().register(functionName, rootNode); 171 context.getFunctionRegistry().register(functionName, rootNode);
173 172
174 functionStartPos = 0; 173 functionStartPos = 0;
175 functionName = null; 174 functionName = null;