mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-20 11:58:45 +00:00
Bump assets/syntaxes/02_Extra/Zig from 87ecbca
to 1a4a384
(#2136)
* Bump assets/syntaxes/02_Extra/Zig from `87ecbca` to `1a4a384`
Bumps [assets/syntaxes/02_Extra/Zig](https://github.com/ziglang/sublime-zig-language) from `87ecbca` to `1a4a384`.
- [Release notes](https://github.com/ziglang/sublime-zig-language/releases)
- [Commits](87ecbcae6f...1a4a38445f
)
---
updated-dependencies:
- dependency-name: assets/syntaxes/02_Extra/Zig
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
* Update tests/syntax-tests/highlighted/Zig/example.zig and CHANGELOG.md
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Nordholts <enselic@gmail.com>
This commit is contained in:
parent
52bab63e18
commit
ef3e398b2b
@ -21,6 +21,7 @@
|
||||
- log syntax: improved handling of escape characters in double quoted strings. See #2123 (@keith-hall)
|
||||
- Associate `/var/spool/mail/*` and `/var/mail/*` with the `Email` syntax. See #2156 (@cyqsimon)
|
||||
- Added cmd-help syntax to scope --help messages. See #2148 (@victor-gp)
|
||||
- Slightly adjust Zig syntax. See #2136 (@Enselic)
|
||||
|
||||
## Themes
|
||||
|
||||
|
2
assets/syntaxes/02_Extra/Zig
vendored
2
assets/syntaxes/02_Extra/Zig
vendored
@ -1 +1 @@
|
||||
Subproject commit 87ecbcae6fb5718369ce3bb3472ca0b2634e78e6
|
||||
Subproject commit 1a4a38445fec495817625bafbeb01e79c44abcba
|
78
tests/syntax-tests/highlighted/Zig/example.zig
vendored
78
tests/syntax-tests/highlighted/Zig/example.zig
vendored
@ -1,18 +1,18 @@
|
||||
[38;2;117;113;94m//! this is a top level doc, starts with "//!"[0m
|
||||
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m std [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m@import[0m[38;2;248;248;242m([0m[38;2;230;219;116m"std"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mstd[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m@import[0m[38;2;248;248;242m([0m[38;2;230;219;116m"std"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;249;38;114mpub[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mfn[0m[38;2;248;248;242m [0m[38;2;166;226;46mmain[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239manyerror[0m[38;2;249;38;114m![0m[3;38;2;102;217;239mvoid[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m stdout [0m[38;2;249;38;114m=[0m[38;2;248;248;242m std.io.[0m[38;2;248;248;242mgetStdOut[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m.[0m[38;2;248;248;242mwriter[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mtry[0m[38;2;248;248;242m stdout.[0m[38;2;248;248;242mprint[0m[38;2;248;248;242m([0m[38;2;230;219;116m"Hello, {}![0m[38;2;190;132;255m\n[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m[38;2;248;248;242m .[0m[38;2;248;248;242m{[0m[38;2;230;219;116m"world"[0m[38;2;248;248;242m}[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mstdout[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;248;248;242mstd[0m[38;2;248;248;242m.[0m[38;2;248;248;242mio[0m[38;2;248;248;242m.[0m[38;2;248;248;242mgetStdOut[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m.[0m[38;2;248;248;242mwriter[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mtry[0m[38;2;248;248;242m [0m[38;2;248;248;242mstdout[0m[38;2;248;248;242m.[0m[38;2;248;248;242mprint[0m[38;2;248;248;242m([0m[38;2;230;219;116m"Hello, {}![0m[38;2;190;132;255m\n[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m[38;2;248;248;242m .[0m[38;2;248;248;242m{[0m[38;2;230;219;116m"world"[0m[38;2;248;248;242m}[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m}[0m
|
||||
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m expect [0m[38;2;249;38;114m=[0m[38;2;248;248;242m std.testing.expect[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;248;248;242mstd[0m[38;2;248;248;242m.[0m[38;2;248;248;242mtesting[0m[38;2;248;248;242m.[0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[3;38;2;102;217;239mtest[0m[38;2;248;248;242m [0m[38;2;230;219;116m"comments"[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m// comments start with "//" until newline[0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m// foo bar baz[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m x [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mtrue[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;117;113;94m// another comment[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mx[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mtrue[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;117;113;94m// another comment[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m([0m[38;2;248;248;242mx[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m}[0m
|
||||
|
||||
@ -25,26 +25,26 @@
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m/// number of nanoseconds past the second[0m
|
||||
[38;2;248;248;242m [0m[38;2;255;255;255mnano[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mu32[0m[38;2;248;248;242m,[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m Self [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;102;217;239m@This[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;166;226;46mSelf[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;102;217;239m@This[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mpub[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mfn[0m[38;2;248;248;242m [0m[38;2;166;226;46munixEpoch[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mSelf[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mSelf[0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m .seconds [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m .nanos [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m .[0m[38;2;248;248;242mseconds[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m .[0m[38;2;248;248;242mnanos[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m}[0m
|
||||
[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m my_val [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114mswitch[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mstd.Target.current.os.tag[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m [0m[38;2;190;132;255m.linux[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;249;38;114m>[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Linux"[0m[38;2;248;248;242m,[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mmy_val[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114mswitch[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mstd[0m[38;2;248;248;242m.[0m[38;2;166;226;46mTarget[0m[38;2;248;248;242m.[0m[38;2;248;248;242mcurrent[0m[38;2;248;248;242m.[0m[38;2;248;248;242mos[0m[38;2;248;248;242m.[0m[38;2;248;248;242mtag[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;190;132;255m .linux[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;249;38;114m>[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Linux"[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;249;38;114m>[0m[38;2;248;248;242m [0m[38;2;230;219;116m"not Linux"[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;166;226;46mBook[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[3;38;2;102;217;239menum[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m paperback[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m hardcover[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m ebook[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m pdf[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mpaperback[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mhardcover[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mebook[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mpdf[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;166;226;46mTokenType[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[3;38;2;102;217;239munion[0m[38;2;248;248;242m([0m[3;38;2;102;217;239menum[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
@ -54,54 +54,54 @@
|
||||
[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;255;255;255marray_lit[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [[0m[38;2;190;132;255m4[0m[38;2;248;248;242m][0m[3;38;2;102;217;239mu8[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m .[0m[38;2;248;248;242m{[0m[38;2;248;248;242m [0m[38;2;190;132;255m11[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m22[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m33[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m44[0m[38;2;248;248;242m [0m[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m sentinal_lit [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [[0m[38;2;190;132;255m_[0m[38;2;248;248;242m:[0m[38;2;190;132;255m0[0m[38;2;248;248;242m][0m[3;38;2;102;217;239mu8[0m[38;2;248;248;242m{[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m3[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m4[0m[38;2;248;248;242m [0m[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242msentinal_lit[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [[0m[38;2;190;132;255m_[0m[38;2;248;248;242m:[0m[38;2;190;132;255m0[0m[38;2;248;248;242m][0m[3;38;2;102;217;239mu8[0m[38;2;248;248;242m{[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m3[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m4[0m[38;2;248;248;242m [0m[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[3;38;2;102;217;239mtest[0m[38;2;248;248;242m [0m[38;2;230;219;116m"address of syntax"[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m// Get the address of a variable:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;255;255;255mx[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mi32[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m1234[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m x_ptr [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242mx[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mx_ptr[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242mx[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m// Dereference a pointer:[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m([0m[38;2;248;248;242mx_ptr[0m[38;2;249;38;114m.*[0m[38;2;248;248;242m [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;190;132;255m1234[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m// When you get the address of a const variable, you get a const pointer to a single item.[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m([0m[38;2;102;217;239m@TypeOf[0m[38;2;248;248;242m([0m[38;2;248;248;242mx_ptr[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;249;38;114m*[0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mi32[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m([0m[38;2;102;217;239m@TypeOf[0m[38;2;248;248;242m([0m[38;2;248;248;242mx_ptr[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;249;38;114m*[0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mi32[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m// If you want to mutate the value, you'd need an address of a mutable variable:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mvar[0m[38;2;248;248;242m [0m[38;2;255;255;255my[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mi32[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m5678[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m y_ptr [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242my[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m([0m[38;2;102;217;239m@TypeOf[0m[38;2;248;248;242m([0m[38;2;248;248;242my_ptr[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;249;38;114m*[0m[3;38;2;102;217;239mi32[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m y_ptr[0m[38;2;249;38;114m.*[0m[38;2;248;248;242m [0m[38;2;249;38;114m+=[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242my_ptr[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242my[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m([0m[38;2;102;217;239m@TypeOf[0m[38;2;248;248;242m([0m[38;2;248;248;242my_ptr[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;249;38;114m*[0m[38;2;248;248;242mi32[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242my_ptr[0m[38;2;249;38;114m.*[0m[38;2;248;248;242m [0m[38;2;249;38;114m+=[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m([0m[38;2;248;248;242my_ptr[0m[38;2;249;38;114m.*[0m[38;2;248;248;242m [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;190;132;255m5679[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m}[0m
|
||||
|
||||
[38;2;117;113;94m// integer literals[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m decimal_int [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m98222[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m hex_int [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0xff[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m another_hex_int [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0xFF[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m octal_int [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0o755[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m binary_int [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0b11110000[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mdecimal_int[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m98222[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mhex_int[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0xff[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242manother_hex_int[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0xFF[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242moctal_int[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0o755[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mbinary_int[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0b11110000[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m// underscores may be placed between two digits as a visual separator[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m one_billion [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m1_000_000_000[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m binary_mask [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0b1_1111_1111[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m permissions [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0o7_5_5[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m big_address [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0xFF80_0000_0000_0000[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mone_billion[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m1_000_000_000[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mbinary_mask[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0b1_1111_1111[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mpermissions[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0o7_5_5[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mbig_address[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0xFF80_0000_0000_0000[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m// float literals[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m floating_point [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m123.0E+77[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m another_float [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m123.0[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m yet_another [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m123.0e+77[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mfloating_point[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m123.0E+77[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242manother_float[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m123.0[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242myet_another[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m123.0e+77[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m hex_floating_point [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x103.70p-5[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m another_hex_float [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x103.70[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m yet_another_hex_float [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x103.70P-5[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mhex_floating_point[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x103.70p-5[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242manother_hex_float[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x103.70[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242myet_another_hex_float[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x103.70P-5[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m// underscores may be placed between two digits as a visual separator[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m lightspeed [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m299_792_458.000_000[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m nanosecond [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0.000_000_001[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m more_hex [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x1234_5678.9ABC_CDEFp-10[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mlightspeed[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m299_792_458.000_000[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mnanosecond[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0.000_000_001[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mmore_hex[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x1234_5678.9ABC_CDEFp-10[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[3;38;2;102;217;239mfn[0m[38;2;248;248;242m [0m[38;2;166;226;46mmax[0m[38;2;248;248;242m([0m[3;38;2;102;217;239mcomptime[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mT[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mtype[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;253;151;31ma[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mT[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mb[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mT[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mT[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242ma [0m[38;2;249;38;114m>[0m[38;2;248;248;242m b[0m[38;2;248;248;242m)[0m[38;2;248;248;242m a [0m[38;2;249;38;114melse[0m[38;2;248;248;242m b[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242ma[0m[38;2;248;248;242m [0m[38;2;249;38;114m>[0m[38;2;248;248;242m [0m[38;2;248;248;242mb[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242ma[0m[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;248;248;242mb[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m}[0m
|
||||
|
Loading…
x
Reference in New Issue
Block a user