Skip to content

Commit

Permalink
path
Browse files Browse the repository at this point in the history
  • Loading branch information
michele-nuzzi committed Feb 7, 2025
1 parent 3e4282d commit cf3742a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/ast/Source/Source.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions src/compiler/AstCompiler/AstCompiler.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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<DiagnosticMessage[]>
{
if(!( src instanceof Source ))
Expand Down
1 change: 0 additions & 1 deletion src/compiler/io/CompilerIoApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
13 changes: 0 additions & 13 deletions src/compiler/Scope.ts → src/compiler/scope/Scope.ts
Original file line number Diff line number Diff line change
@@ -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<string, SymbolInfos>();

Check failure on line 4 in src/compiler/scope/Scope.ts

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest)

Cannot find name 'SymbolInfos'.

Check failure on line 4 in src/compiler/scope/Scope.ts

View workflow job for this annotation

GitHub Actions / CI (macos-latest)

Cannot find name 'SymbolInfos'.
Expand Down
2 changes: 2 additions & 0 deletions src/compiler/scope/symbols/PebbleSym.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

const thing = Symbol();

0 comments on commit cf3742a

Please sign in to comment.