Skip to content

Commit

Permalink
Fix some buggy number patterns.
Browse files Browse the repository at this point in the history
Fixes #507.
  • Loading branch information
alecthomas committed Jun 22, 2021
1 parent d4eaef3 commit 6a6cf17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lexers/circular/php.go
Expand Up @@ -52,7 +52,7 @@ func phpCommonRules() Rules {
{`\d+e[+-]?[0-9]+`, LiteralNumberFloat, nil},
{`0[0-7]+`, LiteralNumberOct, nil},
{`0x[a-f0-9_]+`, LiteralNumberHex, nil},
{`[\d_]+`, LiteralNumberInteger, nil},
{`\d[\d_]*`, LiteralNumberInteger, nil},
{`0b[01]+`, LiteralNumberBin, nil},
{`'([^'\\]*(?:\\.[^'\\]*)*)'`, LiteralStringSingle, nil},
{"`([^`\\\\]*(?:\\\\.[^`\\\\]*)*)`", LiteralStringBacktick, nil},
Expand Down
2 changes: 1 addition & 1 deletion lexers/j/javascript.go
Expand Up @@ -30,7 +30,7 @@ var JavascriptRules = Rules{
{`0[bB][01]+`, LiteralNumberBin, nil},
{`0[oO][0-7]+`, LiteralNumberOct, nil},
{`0[xX][0-9a-fA-F]+`, LiteralNumberHex, nil},
{`[0-9_]+`, LiteralNumberInteger, nil},
{`[0-9][0-9_]*`, LiteralNumberInteger, nil},
{`\.\.\.|=>`, Punctuation, nil},
{`\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?`, Operator, Push("slashstartsregex")},
{`[{(\[;,]`, Punctuation, Push("slashstartsregex")},
Expand Down

0 comments on commit 6a6cf17

Please sign in to comment.