🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

@isl-lang/typechecker

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@isl-lang/typechecker - npm Package Compare versions

Comparing version
0.1.0
to
1.0.0
+101
-31
dist/index.d.cts

@@ -191,32 +191,36 @@ interface SourceLocation {

declare const ErrorCodes: {
readonly UNDEFINED_TYPE: "E0201";
readonly UNDEFINED_ENTITY: "E0301";
readonly UNDEFINED_FIELD: "E0202";
readonly UNDEFINED_VARIABLE: "E0300";
readonly UNDEFINED_BEHAVIOR: "E0302";
readonly UNDEFINED_ENUM_VARIANT: "E0303";
readonly DUPLICATE_TYPE: "E0309";
readonly DUPLICATE_ENTITY: "E0309";
readonly DUPLICATE_FIELD: "E0309";
readonly DUPLICATE_BEHAVIOR: "E0309";
readonly DUPLICATE_VARIABLE: "E0309";
readonly DUPLICATE_PARAMETER: "E0309";
readonly DUPLICATE_ENUM_VARIANT: "E0309";
readonly TYPE_MISMATCH: "E0200";
readonly INCOMPATIBLE_TYPES: "E0203";
readonly INVALID_OPERATOR: "E0204";
readonly INVALID_ARGUMENT_COUNT: "E0205";
readonly INVALID_ARGUMENT_TYPE: "E0206";
readonly OLD_OUTSIDE_POSTCONDITION: "E0304";
readonly RESULT_OUTSIDE_POSTCONDITION: "E0305";
readonly INPUT_INVALID_FIELD: "E0306";
readonly INVALID_LIFECYCLE_STATE: "E0307";
readonly INVALID_LIFECYCLE_TRANSITION: "E0308";
readonly UNDEFINED_LIFECYCLE_STATE: "E0307";
readonly INVALID_ENTITY_LOOKUP: "E0350";
readonly INVALID_ENTITY_EXISTS: "E0351";
readonly INVALID_CONSTRAINT_VALUE: "E0314";
readonly INVALID_CONSTRAINT_TYPE: "E0314";
readonly CIRCULAR_REFERENCE: "E0207";
readonly INVALID_EXPRESSION: "E0371";
readonly CIRCULAR_IMPORT: "ISL_T001";
readonly MODULE_NOT_FOUND: "ISL_T002";
readonly READ_ERROR: "ISL_T003";
readonly PARSE_ERROR: "ISL_T004";
readonly UNDEFINED_TYPE: "ISL_T010";
readonly UNDEFINED_ENTITY: "ISL_T011";
readonly UNDEFINED_FIELD: "ISL_T012";
readonly UNDEFINED_VARIABLE: "ISL_T013";
readonly UNDEFINED_BEHAVIOR: "ISL_T014";
readonly UNDEFINED_ENUM_VARIANT: "ISL_T015";
readonly DUPLICATE_TYPE: "ISL_T020";
readonly DUPLICATE_ENTITY: "ISL_T021";
readonly DUPLICATE_FIELD: "ISL_T022";
readonly DUPLICATE_BEHAVIOR: "ISL_T023";
readonly DUPLICATE_VARIABLE: "ISL_T024";
readonly DUPLICATE_PARAMETER: "ISL_T025";
readonly DUPLICATE_ENUM_VARIANT: "ISL_T026";
readonly TYPE_MISMATCH: "ISL_T030";
readonly INCOMPATIBLE_TYPES: "ISL_T031";
readonly INVALID_OPERATOR: "ISL_T032";
readonly INVALID_ARGUMENT_COUNT: "ISL_T033";
readonly INVALID_ARGUMENT_TYPE: "ISL_T034";
readonly OLD_OUTSIDE_POSTCONDITION: "ISL_T040";
readonly RESULT_OUTSIDE_POSTCONDITION: "ISL_T041";
readonly INPUT_INVALID_FIELD: "ISL_T042";
readonly INVALID_LIFECYCLE_STATE: "ISL_T050";
readonly INVALID_LIFECYCLE_TRANSITION: "ISL_T051";
readonly UNDEFINED_LIFECYCLE_STATE: "ISL_T052";
readonly INVALID_ENTITY_LOOKUP: "ISL_T060";
readonly INVALID_ENTITY_EXISTS: "ISL_T061";
readonly INVALID_CONSTRAINT_VALUE: "ISL_T070";
readonly INVALID_CONSTRAINT_TYPE: "ISL_T071";
readonly CIRCULAR_REFERENCE: "ISL_T080";
readonly INVALID_EXPRESSION: "ISL_T081";
};

@@ -394,2 +398,3 @@ type ErrorCode = typeof ErrorCodes[keyof typeof ErrorCodes];

private typeMap;
private importGraph?;
constructor();

@@ -524,2 +529,67 @@ /**

/**
* Import graph node representing a module
*/
interface ImportGraphNode {
path: string;
ast: unknown;
imports: string[];
importedBy: Set<string>;
symbolTable?: SymbolTableBuilder;
}
/**
* Import graph with cycle detection
*/
interface ImportGraph {
nodes: Map<string, ImportGraphNode>;
cycles: string[][];
}
/**
* Options for import resolution
*/
interface ImportResolverOptions {
basePath: string;
readFile?: (path: string) => Promise<string>;
fileExists?: (path: string) => Promise<boolean>;
parseFile?: (content: string, path: string) => Promise<{
success: boolean;
domain?: unknown;
errors?: unknown[];
}>;
enableCache?: boolean;
}
/**
* Build import graph with cycle detection
*/
declare class ImportGraphResolver {
private options;
private cache;
private diagnostics;
constructor(options: ImportResolverOptions);
private defaultReadFile;
private defaultFileExists;
private defaultParseFile;
getDiagnostics(): Diagnostic[];
/**
* Resolve import graph starting from entry point
*/
resolveGraph(entryPath: string): Promise<ImportGraph>;
/**
* Resolve a single module and its dependencies
*/
private resolveModule;
/**
* Normalize path for consistent handling
*/
private normalizePath;
/**
* Get a location for a path (used for errors)
*/
private getLocationForPath;
/**
* Clear cache
*/
clearCache(): void;
}
/**
* Type check an ISL Domain AST

@@ -544,2 +614,2 @@ *

export { type ASTNode$1 as ASTNode, BOOLEAN_TYPE, type BehaviorResolvedType, DECIMAL_TYPE, DURATION_TYPE, type Diagnostic, type DiagnosticSeverity, type EntityResolvedType, type EnumResolvedType, ErrorCodes, type ErrorResolvedType, ExpressionChecker, type ExpressionContext, type FunctionResolvedType, INT_TYPE, type ListResolvedType, type MapResolvedType, type OptionalResolvedType, PRIMITIVE_TYPES, type PrimitiveResolvedType, type RelatedInformation, type ResolvedConstraint, type ResolvedType, STRING_TYPE, type Scope, type SourceLocation, type StructResolvedType, type Symbol, type SymbolKind, type SymbolModifier, type SymbolTable, SymbolTableBuilder, TIMESTAMP_TYPE, type TypeCheckResult, TypeChecker, TypeResolver, UNKNOWN_TYPE, UUID_TYPE, type UnionResolvedType, type UnknownResolvedType, VOID_TYPE, type VoidResolvedType, check, createError, createPrimitiveType, createWarning, isAssignableTo, isPrimitiveTypeName, typeToString, typesEqual };
export { type ASTNode$1 as ASTNode, BOOLEAN_TYPE, type BehaviorResolvedType, DECIMAL_TYPE, DURATION_TYPE, type Diagnostic, type DiagnosticSeverity, type EntityResolvedType, type EnumResolvedType, ErrorCodes, type ErrorResolvedType, ExpressionChecker, type ExpressionContext, type FunctionResolvedType, INT_TYPE, type ImportGraph, type ImportGraphNode, ImportGraphResolver, type ListResolvedType, type MapResolvedType, type OptionalResolvedType, PRIMITIVE_TYPES, type PrimitiveResolvedType, type RelatedInformation, type ResolvedConstraint, type ResolvedType, STRING_TYPE, type Scope, type SourceLocation, type StructResolvedType, type Symbol, type SymbolKind, type SymbolModifier, type SymbolTable, SymbolTableBuilder, TIMESTAMP_TYPE, type TypeCheckResult, TypeChecker, TypeResolver, UNKNOWN_TYPE, UUID_TYPE, type UnionResolvedType, type UnknownResolvedType, VOID_TYPE, type VoidResolvedType, check, createError, createPrimitiveType, createWarning, isAssignableTo, isPrimitiveTypeName, typeToString, typesEqual };

@@ -191,32 +191,36 @@ interface SourceLocation {

declare const ErrorCodes: {
readonly UNDEFINED_TYPE: "E0201";
readonly UNDEFINED_ENTITY: "E0301";
readonly UNDEFINED_FIELD: "E0202";
readonly UNDEFINED_VARIABLE: "E0300";
readonly UNDEFINED_BEHAVIOR: "E0302";
readonly UNDEFINED_ENUM_VARIANT: "E0303";
readonly DUPLICATE_TYPE: "E0309";
readonly DUPLICATE_ENTITY: "E0309";
readonly DUPLICATE_FIELD: "E0309";
readonly DUPLICATE_BEHAVIOR: "E0309";
readonly DUPLICATE_VARIABLE: "E0309";
readonly DUPLICATE_PARAMETER: "E0309";
readonly DUPLICATE_ENUM_VARIANT: "E0309";
readonly TYPE_MISMATCH: "E0200";
readonly INCOMPATIBLE_TYPES: "E0203";
readonly INVALID_OPERATOR: "E0204";
readonly INVALID_ARGUMENT_COUNT: "E0205";
readonly INVALID_ARGUMENT_TYPE: "E0206";
readonly OLD_OUTSIDE_POSTCONDITION: "E0304";
readonly RESULT_OUTSIDE_POSTCONDITION: "E0305";
readonly INPUT_INVALID_FIELD: "E0306";
readonly INVALID_LIFECYCLE_STATE: "E0307";
readonly INVALID_LIFECYCLE_TRANSITION: "E0308";
readonly UNDEFINED_LIFECYCLE_STATE: "E0307";
readonly INVALID_ENTITY_LOOKUP: "E0350";
readonly INVALID_ENTITY_EXISTS: "E0351";
readonly INVALID_CONSTRAINT_VALUE: "E0314";
readonly INVALID_CONSTRAINT_TYPE: "E0314";
readonly CIRCULAR_REFERENCE: "E0207";
readonly INVALID_EXPRESSION: "E0371";
readonly CIRCULAR_IMPORT: "ISL_T001";
readonly MODULE_NOT_FOUND: "ISL_T002";
readonly READ_ERROR: "ISL_T003";
readonly PARSE_ERROR: "ISL_T004";
readonly UNDEFINED_TYPE: "ISL_T010";
readonly UNDEFINED_ENTITY: "ISL_T011";
readonly UNDEFINED_FIELD: "ISL_T012";
readonly UNDEFINED_VARIABLE: "ISL_T013";
readonly UNDEFINED_BEHAVIOR: "ISL_T014";
readonly UNDEFINED_ENUM_VARIANT: "ISL_T015";
readonly DUPLICATE_TYPE: "ISL_T020";
readonly DUPLICATE_ENTITY: "ISL_T021";
readonly DUPLICATE_FIELD: "ISL_T022";
readonly DUPLICATE_BEHAVIOR: "ISL_T023";
readonly DUPLICATE_VARIABLE: "ISL_T024";
readonly DUPLICATE_PARAMETER: "ISL_T025";
readonly DUPLICATE_ENUM_VARIANT: "ISL_T026";
readonly TYPE_MISMATCH: "ISL_T030";
readonly INCOMPATIBLE_TYPES: "ISL_T031";
readonly INVALID_OPERATOR: "ISL_T032";
readonly INVALID_ARGUMENT_COUNT: "ISL_T033";
readonly INVALID_ARGUMENT_TYPE: "ISL_T034";
readonly OLD_OUTSIDE_POSTCONDITION: "ISL_T040";
readonly RESULT_OUTSIDE_POSTCONDITION: "ISL_T041";
readonly INPUT_INVALID_FIELD: "ISL_T042";
readonly INVALID_LIFECYCLE_STATE: "ISL_T050";
readonly INVALID_LIFECYCLE_TRANSITION: "ISL_T051";
readonly UNDEFINED_LIFECYCLE_STATE: "ISL_T052";
readonly INVALID_ENTITY_LOOKUP: "ISL_T060";
readonly INVALID_ENTITY_EXISTS: "ISL_T061";
readonly INVALID_CONSTRAINT_VALUE: "ISL_T070";
readonly INVALID_CONSTRAINT_TYPE: "ISL_T071";
readonly CIRCULAR_REFERENCE: "ISL_T080";
readonly INVALID_EXPRESSION: "ISL_T081";
};

@@ -394,2 +398,3 @@ type ErrorCode = typeof ErrorCodes[keyof typeof ErrorCodes];

private typeMap;
private importGraph?;
constructor();

@@ -524,2 +529,67 @@ /**

/**
* Import graph node representing a module
*/
interface ImportGraphNode {
path: string;
ast: unknown;
imports: string[];
importedBy: Set<string>;
symbolTable?: SymbolTableBuilder;
}
/**
* Import graph with cycle detection
*/
interface ImportGraph {
nodes: Map<string, ImportGraphNode>;
cycles: string[][];
}
/**
* Options for import resolution
*/
interface ImportResolverOptions {
basePath: string;
readFile?: (path: string) => Promise<string>;
fileExists?: (path: string) => Promise<boolean>;
parseFile?: (content: string, path: string) => Promise<{
success: boolean;
domain?: unknown;
errors?: unknown[];
}>;
enableCache?: boolean;
}
/**
* Build import graph with cycle detection
*/
declare class ImportGraphResolver {
private options;
private cache;
private diagnostics;
constructor(options: ImportResolverOptions);
private defaultReadFile;
private defaultFileExists;
private defaultParseFile;
getDiagnostics(): Diagnostic[];
/**
* Resolve import graph starting from entry point
*/
resolveGraph(entryPath: string): Promise<ImportGraph>;
/**
* Resolve a single module and its dependencies
*/
private resolveModule;
/**
* Normalize path for consistent handling
*/
private normalizePath;
/**
* Get a location for a path (used for errors)
*/
private getLocationForPath;
/**
* Clear cache
*/
clearCache(): void;
}
/**
* Type check an ISL Domain AST

@@ -544,2 +614,2 @@ *

export { type ASTNode$1 as ASTNode, BOOLEAN_TYPE, type BehaviorResolvedType, DECIMAL_TYPE, DURATION_TYPE, type Diagnostic, type DiagnosticSeverity, type EntityResolvedType, type EnumResolvedType, ErrorCodes, type ErrorResolvedType, ExpressionChecker, type ExpressionContext, type FunctionResolvedType, INT_TYPE, type ListResolvedType, type MapResolvedType, type OptionalResolvedType, PRIMITIVE_TYPES, type PrimitiveResolvedType, type RelatedInformation, type ResolvedConstraint, type ResolvedType, STRING_TYPE, type Scope, type SourceLocation, type StructResolvedType, type Symbol, type SymbolKind, type SymbolModifier, type SymbolTable, SymbolTableBuilder, TIMESTAMP_TYPE, type TypeCheckResult, TypeChecker, TypeResolver, UNKNOWN_TYPE, UUID_TYPE, type UnionResolvedType, type UnknownResolvedType, VOID_TYPE, type VoidResolvedType, check, createError, createPrimitiveType, createWarning, isAssignableTo, isPrimitiveTypeName, typeToString, typesEqual };
export { type ASTNode$1 as ASTNode, BOOLEAN_TYPE, type BehaviorResolvedType, DECIMAL_TYPE, DURATION_TYPE, type Diagnostic, type DiagnosticSeverity, type EntityResolvedType, type EnumResolvedType, ErrorCodes, type ErrorResolvedType, ExpressionChecker, type ExpressionContext, type FunctionResolvedType, INT_TYPE, type ImportGraph, type ImportGraphNode, ImportGraphResolver, type ListResolvedType, type MapResolvedType, type OptionalResolvedType, PRIMITIVE_TYPES, type PrimitiveResolvedType, type RelatedInformation, type ResolvedConstraint, type ResolvedType, STRING_TYPE, type Scope, type SourceLocation, type StructResolvedType, type Symbol, type SymbolKind, type SymbolModifier, type SymbolTable, SymbolTableBuilder, TIMESTAMP_TYPE, type TypeCheckResult, TypeChecker, TypeResolver, UNKNOWN_TYPE, UUID_TYPE, type UnionResolvedType, type UnknownResolvedType, VOID_TYPE, type VoidResolvedType, check, createError, createPrimitiveType, createWarning, isAssignableTo, isPrimitiveTypeName, typeToString, typesEqual };
{
"name": "@isl-lang/typechecker",
"version": "0.1.0",
"version": "1.0.0",
"description": "Semantic analyzer for ISL - validates AST, resolves types, builds symbol table",

@@ -42,5 +42,18 @@ "author": "ISL Team",

],
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"test": "vitest run --passWithNoTests",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"test:typecheck-fixtures": "vitest run tests/fixtures.test.ts",
"lint": "eslint src --ext .ts",
"typecheck": "tsc --noEmit",
"clean": "rimraf dist",
"prepublishOnly": "pnpm run build",
"test:unit": "vitest run --passWithNoTests"
},
"dependencies": {
"@isl-lang/parser": "0.1.0",
"@isl-lang/errors": "1.0.0"
"@isl-lang/parser": "workspace:*",
"@isl-lang/errors": "workspace:*"
},

@@ -54,12 +67,3 @@ "devDependencies": {

},
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"lint": "eslint src --ext .ts",
"typecheck": "tsc --noEmit",
"clean": "rimraf dist"
}
}
"sideEffects": false
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display