Skip to content

Commit

Permalink
Merge pull request #117 from takikawa/vlq-example-rebased
Browse files Browse the repository at this point in the history
Add examples for Base64 VLQ encoding
  • Loading branch information
jkup authored Aug 21, 2024
2 parents 9ec39c5 + 1a6cb76 commit fec48d3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions source-map.bs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,22 @@ Note: The values that can be represented by the VLQ Base64 encoded are limited t
means that values exceeding 32-bits are invalid and implementations may reject
them. The sign bit is counted towards the limit, but the continuation bits are not.

<div class="example">
The string `"iB"` represents a [=Base64 VLQ=] with two digits. The first digit
`"i"` encodes the bit pattern `0x100010`, which has a continuation bit of `1` (the
VLQ continues), a sign bit of `0` (non-negative), and the value bits `0x0001`.
The second digit `B` encodes the bit pattern `0x000001`, which has a continuation
bit of `0`, no sign bit, and value bits `0x00001`. The decoding of this VLQ string
is the number 17.
</div>

<div class="example">
The string `"V"` represents a [=Base64 VLQ=] with one digit. The digit
`"V"` encodes the bit pattern `0x010101`, which has a continuation bit of `0`
(no continuation), a sign bit of `1` (negative), and the value bits `0x1010`.
The decoding of this VLQ string is the number -10.
</div>

<dfn>Source Mapping URL</dfn> refers to the URL referencing
the location of a source map from the [=Generated code=].

Expand Down

0 comments on commit fec48d3

Please sign in to comment.