Skip to content

Commit f404649

Browse files
Update literals_identifiers.md
1 parent 0e5e04e commit f404649

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

docs/v3/documentation/smart-contracts/func/docs/literals_identifiers.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,25 @@ Examples of valid literals: `0`, `123`, `-17`, `00987`, `0xef`, `0xEF`, `0x0`, `
1010
## String literals
1111

1212
In FunC, strings are enclosed in double quotes `"`, like `"this is a string"`.<br />
13-
Special characters like `\n` and multi-line strings are not supported.<br />
14-
Optionally, a type can be specified after a string literal, such as `"string"u`.
13+
Optionally, a type can be specified after a string literal, such as `"string"u`.<br />
14+
Special characters like `\n` are not supported, but you can create multi-line <br /> strings by simply writing the text across multiple lines, like this:
15+
```
16+
;; somewhere inside of a function body
17+
18+
var a = """
19+
hash me baby one more time
20+
"""h;
21+
var b = a + 42;
1522
23+
b; ;; 623173419
24+
```
1625

1726
FunC supports the following string types:
1827
* without type – Used for `asm` function definitions and defining a slice constant from an ASCII string.
1928
* `s`— Defines a raw slice constant using its contents (hex-encoded and optionally bit-padded).
2029
* `a`— Creates a slice constant containing a `MsgAddressInt` structure from a given address.
2130
* `u`— Converts an ASCII string into an integer constant, representing its hex values.
22-
* `h`— Generates an integer constant from the first 32 bits of the strings SHA-256 hash.
31+
* `h`— Generates an integer constant from the first 32 bits of the string's SHA-256 hash.
2332
* `H`— Generates an integer constant from the full 256-bit SHA-256 hash of the string.
2433
* `c`— Generates an integer constant from the `crc32` value of the string.
2534

@@ -129,5 +138,4 @@ all optimizations and pre-computations apply efficiently—unlike the older appr
129138

130139

131140

132-
<Feedback />
133-
141+
<Feedback />

0 commit comments

Comments
 (0)