diff --git a/src/ast/Source/Source.ts b/src/ast/Source/Source.ts index d356a6f1..886715d3 100644 --- a/src/ast/Source/Source.ts +++ b/src/ast/Source/Source.ts @@ -1,5 +1,5 @@ import { LIBRARY_PREFIX, PATH_DELIMITER, LIBRARY_SUBST } from "../../common"; -import { mangleInternalPath } from "../../compiler/path/mangleInternalPath"; +import { getInternalPath } from "../../compiler/path/path"; import { CharCode } from "../../utils/CharCode"; import { PebbleStmt } from "../nodes/statements/PebbleStmt"; import { SourceRange } from "./SourceRange"; @@ -39,7 +39,7 @@ export class Source { /** Full source text. */ public text: string ) { - let internalPath = mangleInternalPath(normalizedPath); + let internalPath = getInternalPath( normalizedPath ); this.internalPath = internalPath; let pos = internalPath.lastIndexOf(PATH_DELIMITER); this.simplePath = pos >= 0 ? internalPath.substring(pos + 1) : internalPath; diff --git a/src/compiler/AstCompiler/AstCompiler.ts b/src/compiler/AstCompiler/AstCompiler.ts index 0d6b5e05..b6e1619d 100644 --- a/src/compiler/AstCompiler/AstCompiler.ts +++ b/src/compiler/AstCompiler/AstCompiler.ts @@ -1,6 +1,7 @@ import { ExportStarStmt } from "../../ast/nodes/statements/ExportStarStmt"; import { ImportStarStmt } from "../../ast/nodes/statements/ImportStarStmt"; import { ImportStmt } from "../../ast/nodes/statements/ImportStmt"; +import { PebbleStmt } from "../../ast/nodes/statements/PebbleStmt"; import { Source, SourceKind } from "../../ast/Source/Source"; import { SourceRange } from "../../ast/Source/SourceRange"; import { extension } from "../../common"; @@ -115,9 +116,16 @@ export class AstCompiler extends DiagnosticEmitter { await this._checkCircularDependencies( src ); + await this.compileEntryFileStmts( src.statements ); + return this.diagnostics; } + async compileEntryFileStmts( src: PebbleStmt[] ) + { + + } + async checkCircularDependencies( src: Source | Path ): Promise { if(!( src instanceof Source )) diff --git a/src/compiler/io/CompilerIoApi.ts b/src/compiler/io/CompilerIoApi.ts index 3e70deac..3bfb7902 100644 --- a/src/compiler/io/CompilerIoApi.ts +++ b/src/compiler/io/CompilerIoApi.ts @@ -2,7 +2,6 @@ import { toUtf8 } from "@harmoniclabs/uint8array-utils"; import { DiagnosticMessage } from "../../diagnostics/DiagnosticMessage"; import { MaybePromise } from "../../utils/MaybePromise"; import { ConsoleErrorStream, ConsoleLogStream, IOutputStream, MemoryStream } from "./IOutputStream"; -import { mangleInternalPath } from "../path/mangleInternalPath"; import { removeSingleDotDirsFromPath } from "../path/path"; /** Compiler API options. */ diff --git a/src/compiler/Scope.ts b/src/compiler/scope/Scope.ts similarity index 67% rename from src/compiler/Scope.ts rename to src/compiler/scope/Scope.ts index 83648b98..493ed769 100644 --- a/src/compiler/Scope.ts +++ b/src/compiler/scope/Scope.ts @@ -1,17 +1,4 @@ -export interface SymbolInfos { - /** `true` if the symbol indicates a type */ - isTypeSymbol: boolean; - /** - * if `isTypeSymbol` is `true`, - * this is the definition of the type. - * - * if `isTypeSymbol` is `false`, - * this is the type of the symbol. - */ - type: any; -} - export class Scope { private readonly symbols = new Map(); diff --git a/src/compiler/scope/symbols/PebbleSym.ts b/src/compiler/scope/symbols/PebbleSym.ts new file mode 100644 index 00000000..56d8bcf8 --- /dev/null +++ b/src/compiler/scope/symbols/PebbleSym.ts @@ -0,0 +1,2 @@ + +const thing = Symbol(); \ No newline at end of file