Skip to content

Commit

Permalink
zig: Detect visual separators in integer literals
Browse files Browse the repository at this point in the history
Zig docs: "// underscores may be placed between two digits as a visual
separator"
  • Loading branch information
nyaayaya authored and alecthomas committed Oct 30, 2020
1 parent e3a674c commit 9b3cf51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lexers/z/zig.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ var Zig = internal.Register(MustNewLexer(
{`0x[0-9a-fA-F]+\.?[pP][\-+]?[0-9a-fA-F]+`, LiteralNumberFloat, nil},
{`[0-9]+\.[0-9]+([eE][-+]?[0-9]+)?`, LiteralNumberFloat, nil},
{`[0-9]+\.?[eE][-+]?[0-9]+`, LiteralNumberFloat, nil},
{`0b[01]+`, LiteralNumberBin, nil},
{`0o[0-7]+`, LiteralNumberOct, nil},
{`0x[0-9a-fA-F]+`, LiteralNumberHex, nil},
{`[0-9]+`, LiteralNumberInteger, nil},
{`0b(?:_?[01])+`, LiteralNumberBin, nil},
{`0o(?:_?[0-7])+`, LiteralNumberOct, nil},
{`0x(?:_?[0-9a-fA-F])+`, LiteralNumberHex, nil},
{`(?:_?[0-9])+`, LiteralNumberInteger, nil},
{`@[a-zA-Z_]\w*`, NameBuiltin, nil},
{`[a-zA-Z_]\w*`, Name, nil},
{`\'\\\'\'`, LiteralStringEscape, nil},
Expand Down

0 comments on commit 9b3cf51

Please sign in to comment.