mirror of
https://github.com/luau-lang/luau.git
synced 2024-12-13 05:20:38 +00:00
Update syntax.md
Fix hexadecimal escape sequences
This commit is contained in:
parent
2cd63aa589
commit
053061e3e8
1 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ end
|
|||
|
||||
Note that future versions of Lua extend the Lua 5.1 syntax with the following features; with the exception of the string literals, these are **not** supported by Luau:
|
||||
|
||||
- hexadecimal (`\0x`), Unicode (`\u`) and `\z` escapes for string literals
|
||||
- hexadecimal (`\x`), Unicode (`\u`) and `\z` escapes for string literals
|
||||
- goto statements and labels
|
||||
- bitwise operators
|
||||
- floor division operator (`//`)
|
||||
|
@ -33,7 +33,7 @@ The rest of this document documents additional syntax used in Luau.
|
|||
|
||||
As noted above, Luau implements support for hexadecimal (`\0x`), Unicode (`\u`) and `\z` escapes for string literals. This syntax follows [Lua 5.3 syntax](https://www.lua.org/manual/5.3/manual.html#3.1):
|
||||
|
||||
- `\0xAB` inserts a character with the code 0xAB into the string
|
||||
- `\xAB` inserts a character with the code 0xAB into the string
|
||||
- `\u{ABC}` inserts a UTF8 byte sequence that encodes U+0ABC character into the string (note that braces are mandatory)
|
||||
- `\z` at the end of the line inside a string literal ignores all following whitespace including newlines, which can be helpful for breaking long literals into multiple lines.
|
||||
|
||||
|
|
Loading…
Reference in a new issue