Implicitly alias stdlib exports as program globals, see #8

This commit is contained in:
dcodeIO
2018-01-12 15:36:17 +01:00
parent 3980e53bb7
commit 2df318a7ec
27 changed files with 417 additions and 179 deletions

View File

@ -30,6 +30,7 @@ import {
Node,
NodeKind,
Source,
SourceKind,
TypeNode,
Expression,
@ -104,7 +105,7 @@ export class Parser extends DiagnosticEmitter {
return; // already parsed
this.seenlog.add(normalizedPath);
var source = new Source(path, text, isEntry);
var source = new Source(path, text, isEntry ? SourceKind.ENTRY : path.startsWith("std:") ? SourceKind.STDLIB : SourceKind.DEFAULT);
this.program.sources.push(source);
var tn = new Tokenizer(source, this.program.diagnostics);