diff --git a/.github/workflows/external-links.yml b/.github/workflows/external-links.yml index f8c779b74..452f1d375 100644 --- a/.github/workflows/external-links.yml +++ b/.github/workflows/external-links.yml @@ -12,25 +12,26 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: (docs) Check broken HTTPS links + - name: (docs) Check broken HTTP(S) links uses: lycheeverse/lychee-action@v2 id: lychee with: args: > - -n -s https --exclude-path docs/node_modules - --base 'https://docs.tact-lang.org' + -n -s https -s http --base 'https://docs.tact-lang.org' + --exclude-path docs/node_modules --exclude '.*?\\.(?:jpg|png)' docs/README.md './docs/**/*.mdx' output: "/dev/stdout" fail: false failIfEmpty: false - - name: (dev-docs) Check broken HTTPS links + - name: (dev-docs) Check broken HTTP(S) links uses: lycheeverse/lychee-action@v2 id: lychee_dev with: args: > - -n -s https --exclude-path node_modules --exclude-path docs + -n -s https -s http + --exclude-path node_modules --exclude-path docs './**/*.md' output: "/dev/stdout" fail: false diff --git a/dev-docs/CHANGELOG.md b/dev-docs/CHANGELOG.md index 4666d73d4..39684527d 100644 --- a/dev-docs/CHANGELOG.md +++ b/dev-docs/CHANGELOG.md @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The `replace` and `replaceGet` methods for the `Map` type: PR [#941](https://github.com/tact-lang/tact/pull/941) - Utility for logging errors in code that was supposed to be unreachable: PR [#991](https://github.com/tact-lang/tact/pull/991) - Ability to specify a compile-time message opcode expression: PR [#1188](https://github.com/tact-lang/tact/pull/1188) -- The `VarInt16`, `VarInt32`, `VarUint16`, `VarUint32` integer serialization types: PR [#1186](https://github.com/tact-lang/tact/pull/1186) +- The `VarInt16`, `VarInt32`, `VarUint16`, `VarUint32` integer serialization types: PR [#1186](https://github.com/tact-lang/tact/pull/1186), PR [#1274](https://github.com/tact-lang/tact/pull/1274) - `unboc`: a standalone CLI utility to expose Tact's TVM disassembler: PR [#1259](https://github.com/tact-lang/tact/pull/1259) - Added alternative parser: PR [#1258](https://github.com/tact-lang/tact/pull/1258) - Support for block statements: PR [#1334](https://github.com/tact-lang/tact/pull/1334) diff --git a/docs/grammars/grammar-tact.json b/docs/grammars/grammar-tact.json index 3e3aefdd2..f04339ce1 100644 --- a/docs/grammars/grammar-tact.json +++ b/docs/grammars/grammar-tact.json @@ -402,7 +402,7 @@ "comment": "Serialization", "patterns": [ { - "match": "(?
@@ -129,9 +129,13 @@ Name | [TL-B][tlb] | Inclusive range | Sp `uintX{:tact}` | [`uintX`][tlb-builtin] | $0$ to $2^{X} - 1$ | $X$ bits, where $X$ is between $1$ and $256$ `intX{:tact}` | [`intX`][tlb-builtin] | $-2^{X - 1}$ to $2^{X - 1} - 1$ | $X$ bits, where $X$ is between $1$ and $257$ -### Variable `coins` type {#serialization-coins} +### Types of variable bit-width {#serialization-varint} -In Tact, `coins{:tact}` is an alias to [`VarUInteger 16`][varuint] in [TL-B][tlb] representation, i.e. it takes a variable bit length depending on the optimal number of bytes needed to store the given integer and is commonly used for storing [nanoToncoin](/book/integers#nanotoncoin) amounts. +Name | [TL-B][tlb] | Inclusive range | Space taken +:------------: | :-------------------------: | :------------------: | :------------------------- +`coins{:tact}` | [`VarUInteger 16`][varuint] | $0$ to $2^{120} - 1$ | between $4$ and $124$ bits + +In Tact, variable `coins{:tact}` format is an alias to [`VarUInteger 16`][varuint] in [TL-B][tlb] representation, i.e. it takes a variable bit length depending on the optimal number of bytes needed to store the given integer and is commonly used for storing [nanoToncoin](/book/integers#nanotoncoin) amounts. This serialization format consists of two [TL-B fields](https://docs.ton.org/develop/data-formats/tl-b-language#field-definitions): @@ -166,6 +170,45 @@ struct Scrooge { } ``` +Name | [TL-B][tlb] | Inclusive range | Space taken +:----------------: | :-------------------------: | :-------------------------: | :------------------------- +`varuint16{:tact}` | [`VarUInteger 16`][varuint] | same as `coins{:tact}` | same as `coins{:tact}` +`varint16{:tact}` | `VarInteger 16` | $-2^{119}$ to $2^{119} - 1$ | between $4$ and $124$ bits +`varuint32{:tact}` | [`VarUInteger 32`][varuint] | $0$ to $2^{248} - 1$ | between $5$ and $253$ bits +`varint32{:tact}` | `VarInteger 32` | $-2^{247}$ to $2^{247} - 1$ | between $5$ and $253$ bits + +