Skip to content

Commit

Permalink
Initial support for "r" numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
sogaiu committed Jul 1, 2020
1 parent e8fb49d commit 8b36213
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rouge/lexers/janet.rb
Expand Up @@ -113,11 +113,12 @@ def name_token(name)
rule %r/\s+/m, Text::Whitespace

# exactly where underscores can go is not regular
# not going to try to restrict initial number to be between 2 and 36
rule %r/[+-]?\d+r[0-9a-zA-Z][0-9a-zA-Z_]*(&[+-]?[0-9a-zA-Z]+)?/, Num::Float
rule %r/[+-]?0x[0-9a-fA-F][_0-9a-fA-F]*/, Num::Hex
# this covers integers as well
rule %r/[+-]?\d[\d_]*(\.[\d_]+)?([eE][+-]?\d+)?/, Num::Float
rule %r/[+-]?\.\d[\d_]*([eE][+-]?\d+)?/, Num::Float
# XXX: r

rule %r/@?"(\\.|[^"])*"/, Str
rule %r/'#{symbol}/, Str::Symbol
Expand Down

0 comments on commit 8b36213

Please sign in to comment.