You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// using result.codeBoc64, you can construct a cell
55
-
let codeCell =Cell.fromBoc(Buffer.from(result.codeBoc64, "base64"))[0]
52
+
let codeCell =Cell.fromBoc(Buffer.from(result.codeBoc64, 'base64'))[0]
56
53
// result has several (probably useful) fields, look up TolkResultSuccess
57
54
}
58
55
@@ -62,8 +59,9 @@ async function showTolkVersion() {
62
59
}
63
60
```
64
61
65
-
The only point to pay attention to is `fsReadCallback`. It's called for every `.tolk` file, input or imported, and you should synchronously return file contents.
62
+
The only point to pay attention to is `fsReadCallback`. It's called for every `.tolk` file, input or imported, and you should synchronously return file contents.
66
63
tolk-js does not access filesystem itself, it just provides a flexible callback, so you can make it easily work if you have file contents in memory, for example:
64
+
67
65
```js
68
66
let sources = {
69
67
'main.tolk':'import "utils/math.tolk"',
@@ -77,18 +75,18 @@ runTolkCompiler({
77
75
```
78
76
79
77
The function `runTolkCompiler()` accepts the following properties (look up `TolkCompilerConfig`):
-`withStackComments` (default false) — Fift output will contain stack comments, if you wish to debug its output
83
+
-`withSrcLineComments` (default false) — Fift output will contain line comments from original .tolk files
84
+
-`experimentalOptions` (default '') — you can pass experimental compiler options here
87
85
88
86
## Embedded stdlib functions
89
87
90
-
Tolk standard functions (`beginCell`, `assertEnd`, and lots of others) are available out of the box *(if you worked with FunC earlier, you had to download stdlib.fc and store in your project; in Tolk, you don't need any additional files)*.
88
+
Tolk standard functions (`beginCell`, `assertEnd`, and lots of others) are available out of the box _(if you worked with FunC earlier, you had to download stdlib.fc and store in your project; in Tolk, you don't need any additional files)_.
91
89
92
90
It works, because all stdlib files are embedded into JS, placed near wasm. If you `import "@stdlib/tvm-dicts"` for example, tolk-js will handle it, `fsReadCallback` won't be called.
93
91
94
-
Note, that folder `tolk-stdlib/` and files within it exist only for IDE purposes. For example, if you use blueprint or tolk-js directly, JetBrains and VS Code plugins locate this folder and auto-complete stdlib functions.
92
+
Note, that folder `tolk-stdlib/` and files within it exist only for IDE purposes. For example, if you use blueprint or tolk-js directly, JetBrains and VS Code plugins locate this folder and auto-complete stdlib functions.
0 commit comments