Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1645bd0
feat: new parser
verytactical Apr 13, 2025
4386e4c
generics
verytactical Apr 13, 2025
b3afb2b
unions
verytactical Apr 13, 2025
889acc4
type aliases
verytactical Apr 13, 2025
bd66650
fix alias
verytactical Apr 15, 2025
0637ddb
fs
verytactical Apr 15, 2025
de3c322
fmt
verytactical Apr 15, 2025
4c78f08
fmt broke fmt
verytactical Apr 15, 2025
87f6b03
import resolution
verytactical Apr 15, 2025
e356219
comments
verytactical Apr 15, 2025
fdcb7e7
comments
verytactical Apr 15, 2025
197dca0
refactor
verytactical Apr 16, 2025
b8818e8
map literals
verytactical Apr 24, 2025
cd3b36f
circular imports
verytactical Apr 25, 2025
0374eba
scoping
verytactical May 1, 2025
f297ec4
scoping
verytactical May 1, 2025
272b86f
1
verytactical May 8, 2025
d1e3ebb
1
verytactical May 13, 2025
25bc510
debugging
verytactical May 15, 2025
8607ec8
debugging
verytactical May 15, 2025
9dd7523
1
verytactical May 15, 2025
bc3860f
1
verytactical May 25, 2025
0e33455
1
verytactical May 26, 2025
b9e9720
1
verytactical May 28, 2025
279083b
1
verytactical May 30, 2025
8a008f5
1
verytactical May 31, 2025
c25640c
1
verytactical May 31, 2025
8975f1e
Merge branch 'main' into src-new
May 31, 2025
c47a7e2
1
verytactical May 31, 2025
f3502c0
1
verytactical May 31, 2025
951cc79
1
verytactical Jun 1, 2025
21036c6
cleanup
verytactical Jun 1, 2025
efc2c4d
1
verytactical Jun 1, 2025
f779677
rec defs
verytactical Jun 2, 2025
6f16951
move errors
verytactical Jun 2, 2025
0bede3a
fmt
verytactical Jun 2, 2025
9808d37
1
verytactical Jun 5, 2025
8f713b1
1
verytactical Jun 13, 2025
1e78dd5
1
verytactical Jun 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run _cli.build.ts",
"type": "node",
"request": "launch",
"runtimeExecutable": "bash",
"args": [
"-lc",
"clear; ts-node ${workspaceFolder}/src/next/test/_cli.build.ts ${file}"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"env": {
"NODE_OPTIONS": "--stack-trace-limit=100000"
}
}
]
}
Empty file added find
Empty file.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"@types/glob": "^8.1.0",
"@types/jest": "^29.5.12",
"@types/node": "^22.5.0",
"@types/serialize-javascript": "^5.0.4",
"@typescript-eslint/eslint-plugin": "^8.21.0",
"@typescript-eslint/parser": "^8.21.0",
"allure-commandline": "^2.34.0",
Expand All @@ -140,6 +141,7 @@
"knip": "^5.24.1",
"prando": "^6.0.1",
"prettier": "^3.2.5",
"serialize-javascript": "^6.0.2",
"rimraf": "^6.0.1",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
Expand Down
165,818 changes: 165,818 additions & 0 deletions result.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions spell/cspell-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Comptime
CSBT
Daniil
Danil
dealias
dealiased
decompilation
Decompilation
decompile
Expand All @@ -55,10 +57,12 @@ errno
Esorat
Excno
extracurrency
Fieldish
flamegraph
flamegraphs
forall
formedness
froms
frontmatter
funcfiftlib
funcid
Expand All @@ -77,6 +81,7 @@ Hoppity
idict
Ikko
Ilya
implicits
infixl
infixr
initof
Expand Down Expand Up @@ -127,12 +132,14 @@ miscompilation
misparse
misparsed
mktemp
Monoid
multiformats
nanoton
nanotons
Nemo
Neovim
nextra
nexts
nobounce
nocheck
noexcept
Expand All @@ -151,6 +158,7 @@ pinst
POSIX
postpack
prando
prevs
quadtree
quadtrees
RANDU
Expand All @@ -174,6 +182,7 @@ seti
shardchains
shiki
Shvetc
Signedness
skywardboundd
Stateinit
statinit
Expand Down Expand Up @@ -207,6 +216,7 @@ Topup
Tradoor
Trunov
typechecker
typedecl
udict
uintptr
uints
Expand Down
4 changes: 2 additions & 2 deletions src/cli/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export const isColorSupported = () => {
if (process.platform === "win32") {
const [major, _, build] = release().split(".").map(Number);
// Windows 10, Build 10586+
return (
(major && major > 10) || (major === 10 && build && build >= 10586)
return Boolean(
(major && major > 10) || (major === 10 && build && build >= 10586),
);
}
if (process.stdout.isTTY && process.env.TERM !== "dumb") {
Expand Down
9 changes: 7 additions & 2 deletions src/error/logger-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,15 @@ const mapBaseLogger = <M1, M2, R>(
},
});

/**
* `SourceLogger` or top-level `Logger`
*/
export interface AnyLogger<M, R> extends Formatter<M>, BaseLogger<M, R> {}

/**
* Logger that knows about currently compiled file
*/
export interface SourceLogger<M, R> extends Formatter<M>, BaseLogger<M, R> {
export interface SourceLogger<M, R> extends AnyLogger<M, R> {
/**
* Choose range where an error will be shown
*/
Expand All @@ -110,7 +115,7 @@ export interface SourceLogger<M, R> extends Formatter<M>, BaseLogger<M, R> {
/**
* Top-level logger
*/
export interface Logger<M, R> extends Formatter<M>, BaseLogger<M, R> {
export interface Logger<M, R> extends AnyLogger<M, R> {
/**
* Set currently compiled source in logging context
*/
Expand Down
8 changes: 0 additions & 8 deletions src/imports/path.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { throwInternalCompilerError } from "@/error/errors";
import { repeat } from "@/utils/array";

// Witness tag. Do not use, do not export.
const pathTag = Symbol("path");

/**
* Safe relative path
*/
Expand All @@ -16,10 +13,6 @@ export type RelativePath = {
* /-separated strings that go after optional ../
*/
readonly segments: readonly string[];
/**
* Proof that path was created by RelativePath constructor
*/
readonly [pathTag]: true;
};

/**
Expand All @@ -33,7 +26,6 @@ const RelativePath = (
throwInternalCompilerError("Negative number of ../ in path");
}
const result: RelativePath = {
[pathTag]: true,
stepsUp,
segments: Object.freeze(segments),
};
Expand Down
121 changes: 121 additions & 0 deletions src/next/ast/allocation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import type * as Ast from "@/next/ast";
// import * as E from "@/next/types/errors";

export type TlbType =
| TlbInt
| TlbVarInt
| TlbBool
| TlbAddress
| TlbString
| TlbUnknown
| TlbLiteral
| TlbBits
| TlbMap
| TlbRef
| TlbMaybe
| TlbFields
| TlbUnion;

export type TlbTypeNoRef =
| TlbInt
| TlbVarInt
| TlbBool
| TlbAddress
| TlbLiteral
| TlbBits
| TlbMaybeNoRef
| TlbFieldsNoRef
| TlbUnionNoRef;

export type TlbInt = {
readonly kind: "int";
readonly sign: Ast.Signedness;
readonly width: number;
};

export type TlbVarInt = {
readonly kind: "varint";
readonly sign: Ast.Signedness;
readonly width: Ast.VarIntWidth;
};

export type TlbBool = {
readonly kind: "bool";
};

export type TlbAddress = {
readonly kind: "address";
};

export type TlbString = {
readonly kind: "string";
};

export type TlbUnknown = {
// aka ^Cell
readonly kind: "unknown";
};

export type TlbLiteral = {
readonly kind: "literal";
readonly width: number;
readonly value: bigint;
};

export type TlbBits = {
readonly kind: "ref";
readonly width: number;
};

export type TlbRef = {
readonly kind: "ref";
readonly type: TlbType;
};

export type TlbMap = {
readonly kind: "map";
readonly key: TlbTypeNoRef;
readonly value: TlbType;
};

export type TlbMaybe = {
readonly kind: "maybe";
readonly type: TlbType;
};

export type TlbFields = {
readonly kind: "fields";
readonly children: readonly TlbType[];
};

export type TlbUnion = {
readonly kind: "union";
readonly prefixWidth: number;
readonly children: readonly TlbCase[];
};

export type TlbCase = {
readonly prefix: bigint;
readonly type: TlbType;
};

export type TlbMaybeNoRef = {
readonly kind: "maybe";
readonly type: TlbCaseNoRef;
};

export type TlbFieldsNoRef = {
readonly kind: "fields";
readonly children: readonly TlbCaseNoRef[];
};

export type TlbUnionNoRef = {
readonly kind: "union";
readonly prefixWidth: number;
readonly children: readonly TlbCaseNoRef[];
};

export type TlbCaseNoRef = {
readonly prefix: bigint;
readonly type: TlbCaseNoRef;
};
Loading