Skip to content

Commit

Permalink
Merge branch 'main' into move-constant
Browse files Browse the repository at this point in the history
  • Loading branch information
jeshecdom committed Feb 4, 2025
2 parents 3c6cc09 + 393e3b4 commit 9a3040a
Show file tree
Hide file tree
Showing 80 changed files with 1,944 additions and 1,172 deletions.
2 changes: 1 addition & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"src/grammar/next/grammar.gg",
"src/grammar/next/grammar.ts",
"src/stdlib/stdlib.ts",
"src/stdlib/stdlib/stdlib.fc",
"src/stdlib/stdlib/std/stdlib.fc",
"src/test/compilation-failed/const-eval-failed.spec.ts",
"src/test/e2e-emulated/address.spec.ts",
"src/test/e2e-emulated/intrinsics.spec.ts",
Expand Down
1 change: 1 addition & 0 deletions dev-docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support for using a constant within another constant and for the default value of a struct field before constant declaration: PR [#1478](https://github.com/tact-lang/tact/pull/1478)
- Incorrect call generation to a mutation function: PR [#1608](https://github.com/tact-lang/tact/pull/1608)
- Allow constant/trait constants depend on each other: PR [#1622](https://github.com/tact-lang/tact/pull/1622)
- Combine all generated FunC code into a single file: PR [#1698](https://github.com/tact-lang/tact/pull/1698)

### Docs

Expand Down
11 changes: 11 additions & 0 deletions dev-docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@ The helper file [src/grammar/grammar.ts](../src/grammar/prev/grammar.ts) contain

The [src/grammar/test](../src/grammar/test) folder contains Tact files that are supposed to be parsed without any issues, and the [src/grammar/test-failed](../src/grammar/test-failed) folder contains grammatically incorrect test files which should result in parser errors. The parser error messages and the locations they point to are fixed in the [src/grammar/**snapshots**/grammar.spec.ts.snap](../src/grammar/prev/__snapshots__/grammar.spec.ts.snap) Jest snapshot file.

### Standard library

The [src/stdlib/stdlib](../src/stdlib/stdlib) folder contains source code of standard library. It has two subfolders:

- [src/stdlib/stdlib/std](../src/stdlib/stdlib/std) contains ambient definition that are present in every `.tact` file. It's loaded automatically by compiler, and should never otherwise be included.
- [src/stdlib/stdlib/libs](../src/stdlib/stdlib/libs/) contains standard library exports available via `@stdlib/...` imports from source code. Source code inside of these files is just a regular `.tact` source, and shouldn't import anything from `/std` folder either.

The library is built by `yarn gen:stdlib` script into [stdlib.ts](../src/stdlib/stdlib.ts) file that holds base64 of all the Tact and FunC sources in the library. Whenever the source code of the standard library gets changed, a new `stdlib.ts` must be generated.

Whenever CLI (or external tooling) needs to access the source of the standard library, it should initialize the virtual filesystem from `stdlib.ts`. Accessing the source of the standard library directly is error-prone and discouraged. For example, the standard library might not be found, if compiler is included as a library.

### Typechecker

The Tact type-checker's implementation can be found mostly in the following files:
Expand Down
6 changes: 6 additions & 0 deletions jest-ci.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const mainConfig = require("./jest.config");

module.exports = {
...mainConfig,
maxWorkers: "2",
};
10 changes: 5 additions & 5 deletions jest-fast.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const mainConfig = require("./jest.config");

module.exports = {
preset: "ts-jest",
...mainConfig,
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
},
testEnvironment: "node",
testPathIgnorePatterns: [
"/node_modules/",
"/dist/",
"/src/test/e2e-emulated/map*",
"/src/cli/e2e.spec.ts",
"/src/ast/fuzz.spec.ts",
"/src/test/benchmarks/jetton/jetton.spec.ts",
],
maxWorkers: "8",
globalSetup: "./jest.setup.js",
globalTeardown: "./jest.teardown.js",
snapshotSerializers: ["@tact-lang/ton-jest/serializers"],
};
5 changes: 1 addition & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
module.exports = {
preset: "ts-jest",
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
},
testEnvironment: "node",
testPathIgnorePatterns: ["/node_modules/", "/dist/"],
maxWorkers: "8",
globalSetup: "./jest.globalSetup.js",
setupFiles: ["./jest.setup.js"],
globalTeardown: "./jest.teardown.js",
snapshotSerializers: ["@tact-lang/ton-jest/serializers"],
maxWorkers: "4",
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"test": "jest",
"test:fast": "jest --config=./jest-fast.config.js",
"bench": "yarn gen:contracts:benchmarks && jest ./src/test/benchmarks",
"coverage": "cross-env COVERAGE=true jest",
"coverage": "cross-env COVERAGE=true jest --config=./jest-ci.config.js",
"type": "tsc --noEmit",
"lint": "yarn eslint .",
"fmt": "yarn prettier -l -w .",
Expand Down Expand Up @@ -66,7 +66,7 @@
},
"dependencies": {
"@tact-lang/opcode": "^0.0.18",
"@ton/core": "0.59.1",
"@ton/core": "0.60.0",
"@ton/crypto": "^3.2.0",
"@tonstudio/parser-runtime": "^0.0.1",
"blockstore-core": "1.0.5",
Expand Down
95 changes: 29 additions & 66 deletions spell/cspell-list.txt
Original file line number Diff line number Diff line change
@@ -1,80 +1,33 @@
Brujin
bocchi
Cheatsheet
Cheatsheets
Comptime
Compilables
Daniil
Decompilation
Decompiled
Descr
Domínguez
Epva
Georgiy
Héctor
IPFS
Jesús
Jetton
Jettons
Komarov
Korshakov
Laika
Masterchain
Merkle
Neovim
Nonterminal
Novus
Offchain
Offchain
Parens
RANDU
STON.fi
Satoshi
Seamus
Sedov
Stateinit
Ston
Stonfi
Sánchez
TIMELOCK
Tactina
Tarjan
Timeouted
Toncoin
Toncoins
Topup
Trunov
Uninit
alnum
assgn
astrojs
augmentedassign
babecafe
basechain
basechain
bitcode
bitstring
bitstrings
blockstore
bocchi
bounceable
bounceable
Brujin
cheatsheet
Cheatsheet
cheatsheets
Brujin
Cheatsheets
cleanall
codegen
comptime
compilables
Compilables
comptime
Comptime
Daniil
decompilation
Decompilation
decompile
Decompiled
decompiler
decompiles
decompiles
decompiling
decompiling
dentry
Descr
Expand All @@ -83,6 +36,7 @@ divmod
dnsresolve
Domínguez
elseifnot
Epva
forall
formedness
frontmatter
Expand All @@ -100,10 +54,13 @@ infixr
initof
Ints
ipfs
IPFS
ipld
Jesús
jetton
Jetton
jettons
Jettons
jojo
jsxdev
keccak
Expand All @@ -113,30 +70,32 @@ Korshakov
Laika
langle
langtools
logomark
letrec
Liskov
logomark
lparen
lvalue
lvalues
masterchain
Masterchain
mathrm
maxint
Merkle
minmax
mintable
mktemp
multiformats
nanotons
nanoton
nextra
nanotons
Neovim
nextra
nocheck
noexcept
nonterminal
omelander
Nonterminal
Novus
Offchain
omelander
Parens
pgen
pinst
Expand All @@ -145,19 +104,21 @@ postpack
prando
quadtree
quadtrees
RANDU
rangle
rawslice
renamer
respecifying
replaceget
respecifying
rparen
rugpull
rugpulled
Sánchez
Satoshi
sctx
Sedov
seamus
seqno
Seamus
Sedov
seqno
seti
shardchains
Expand All @@ -167,40 +128,42 @@ stdlib
stdlibs
stmts
Ston
STON.fi
Stonfi
storer
struct
structs
styleguide
subfolders
subtyping
supertypes
Tactina
Tarjan
testdata
TIMELOCK
timeouted
Timeouted
Toncoin
Toncoins
tonstudio
Topup
Trunov
timeouted
typechecker
udict
uintptr
uints
unboc
uncons
uninit
Uninit
unixfs
untypable
varint
varuint
viiii
varint
storer
Ints
vogons
workchain
workchain
workchains
xffff
xtwitter
привет
letrec
10 changes: 7 additions & 3 deletions src/abi/AbiFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ import { SrcInfo } from "../grammar";

export type AbiFunction = {
name: string;
resolve: (ctx: CompilerContext, args: TypeRef[], loc: SrcInfo) => TypeRef;
resolve: (
ctx: CompilerContext,
args: readonly TypeRef[],
loc: SrcInfo,
) => TypeRef;
generate: (
ctx: WriterContext,
args: TypeRef[],
resolved: AstExpression[],
args: readonly TypeRef[],
resolved: readonly AstExpression[],
loc: SrcInfo,
) => string;
};
Loading

0 comments on commit 9a3040a

Please sign in to comment.