Skip to content

Commit

Permalink
enh(haskell) Add support for NumericalUnderscores
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnbastiaan committed Apr 19, 2021
1 parent 90eb62c commit f7bb34a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/languages/haskell.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,16 @@ export default function(hljs) {
PREPROCESSOR,

// Literals and names.
hljs.inherit(hljs.BINARY_NUMBER_MODE, {
begin: '\\b(0b[01_]+)'
}),

hljs.inherit(hljs.C_NUMBER_MODE, {
begin:'(-?)(\\b0[xX][a-fA-F0-9_]+|(\\b(\\d|_)+(\\.(\\d|_)*)?|\\.(\\d|_)+)([eE][-+]?(\\d|_)+)?)'
}),

// TODO: characters.
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE,
hljs.BINARY_NUMBER_MODE,
CONSTRUCTOR,
hljs.inherit(hljs.TITLE_MODE, {
begin: '^[_a-z][\\w\']*'
Expand Down

0 comments on commit f7bb34a

Please sign in to comment.