Conversation
|
(Pushed a commit to fix line endings, can you configure Git's core.autocrlf for the future? Thanks.) |
Thank you, I thought I'd fixed them. Sorry for the inconvenience |
pygments/lexers/gleam.py
Outdated
| (r'[a-zA-Z_/]\w*', Name), | ||
|
|
||
| # numbers | ||
| (r'(\d+((_\d+)+)?\.(?!\.)(\d+((_\d+)+)?)?|\.\d+((_\d+)+)?)([eEf][+-]?[0-9]+)?', Number.Float), |
There was a problem hiding this comment.
| (r'(\d+((_\d+)+)?\.(?!\.)(\d+((_\d+)+)?)?|\.\d+((_\d+)+)?)([eEf][+-]?[0-9]+)?', Number.Float), | |
| (r'(\d+(_\d+)*\.(?!\.)(\d+(_\d+)*)?|\.\d+(_\d+)*)([eEf][+-]?[0-9]+)?', Number.Float), |
(X+)? is just X*.
pygments/lexers/gleam.py
Outdated
|
|
||
| # numbers | ||
| (r'(\d+((_\d+)+)?\.(?!\.)(\d+((_\d+)+)?)?|\.\d+((_\d+)+)?)([eEf][+-]?[0-9]+)?', Number.Float), | ||
| (r'\d+((_\d+)+)?[eEf][+-]?[0-9]+', Number.Float), |
There was a problem hiding this comment.
| (r'\d+((_\d+)+)?[eEf][+-]?[0-9]+', Number.Float), | |
| (r'\d+(_\d+)*[eEf][+-]?[0-9]+', Number.Float), |
pygments/lexers/gleam.py
Outdated
| # numbers | ||
| (r'(\d+((_\d+)+)?\.(?!\.)(\d+((_\d+)+)?)?|\.\d+((_\d+)+)?)([eEf][+-]?[0-9]+)?', Number.Float), | ||
| (r'\d+((_\d+)+)?[eEf][+-]?[0-9]+', Number.Float), | ||
| (r'0[xX][a-fA-F0-9]+((_[a-fA-F0-9]+)+)?(\.([a-fA-F0-9]+((_[a-fA-F0-9]+)+)?)?)?p[+-]?\d+', Number.Float), |
There was a problem hiding this comment.
| (r'0[xX][a-fA-F0-9]+((_[a-fA-F0-9]+)+)?(\.([a-fA-F0-9]+((_[a-fA-F0-9]+)+)?)?)?p[+-]?\d+', Number.Float), | |
| (r'0[xX][a-fA-F0-9]+(_[a-fA-F0-9]+)*(\.([a-fA-F0-9]+(_[a-fA-F0-9]+)*)?)?p[+-]?\d+', Number.Float), |
pygments/lexers/gleam.py
Outdated
| (r'(\d+((_\d+)+)?\.(?!\.)(\d+((_\d+)+)?)?|\.\d+((_\d+)+)?)([eEf][+-]?[0-9]+)?', Number.Float), | ||
| (r'\d+((_\d+)+)?[eEf][+-]?[0-9]+', Number.Float), | ||
| (r'0[xX][a-fA-F0-9]+((_[a-fA-F0-9]+)+)?(\.([a-fA-F0-9]+((_[a-fA-F0-9]+)+)?)?)?p[+-]?\d+', Number.Float), | ||
| (r'0[bB][01]+((_[01]+)+)?', Number.Bin), |
There was a problem hiding this comment.
| (r'0[bB][01]+((_[01]+)+)?', Number.Bin), | |
| (r'0[bB][01]+(_[01]+)*', Number.Bin), |
pygments/lexers/gleam.py
Outdated
| (r'\d+((_\d+)+)?[eEf][+-]?[0-9]+', Number.Float), | ||
| (r'0[xX][a-fA-F0-9]+((_[a-fA-F0-9]+)+)?(\.([a-fA-F0-9]+((_[a-fA-F0-9]+)+)?)?)?p[+-]?\d+', Number.Float), | ||
| (r'0[bB][01]+((_[01]+)+)?', Number.Bin), | ||
| (r'0[oO][0-7]+((_[0-7]+)+)?', Number.Oct), |
There was a problem hiding this comment.
| (r'0[oO][0-7]+((_[0-7]+)+)?', Number.Oct), | |
| (r'0[oO][0-7]+(_[0-7]+)*', Number.Oct), |
pygments/lexers/gleam.py
Outdated
| (r'0[xX][a-fA-F0-9]+((_[a-fA-F0-9]+)+)?(\.([a-fA-F0-9]+((_[a-fA-F0-9]+)+)?)?)?p[+-]?\d+', Number.Float), | ||
| (r'0[bB][01]+((_[01]+)+)?', Number.Bin), | ||
| (r'0[oO][0-7]+((_[0-7]+)+)?', Number.Oct), | ||
| (r'0[xX][a-fA-F0-9]+((_[a-fA-F0-9]+)+)?', Number.Hex), |
There was a problem hiding this comment.
| (r'0[xX][a-fA-F0-9]+((_[a-fA-F0-9]+)+)?', Number.Hex), | |
| (r'0[xX][a-fA-F0-9]+(_[a-fA-F0-9]+)*', Number.Hex), |
pygments/lexers/gleam.py
Outdated
| (r'0[bB][01]+((_[01]+)+)?', Number.Bin), | ||
| (r'0[oO][0-7]+((_[0-7]+)+)?', Number.Oct), | ||
| (r'0[xX][a-fA-F0-9]+((_[a-fA-F0-9]+)+)?', Number.Hex), | ||
| (r'\d+((_\d+)+)?', Number.Integer), |
There was a problem hiding this comment.
| (r'\d+((_\d+)+)?', Number.Integer), | |
| (r'\d+(_\d+)*', Number.Integer), |
There was a problem hiding this comment.
This and other suggestions have been implemented, thanks for the input
Yep, I'll pick up the requested changes in the next few days. Just been busy with other things. |
|
Merged, thanks! |
|
Just wanted to give you guys a heads up that the documentation on your website states that Gleam support was added in 2.18, but it appears here that it is planned for 2.19. Thanks a lot for all your hard work and looking forward to the next release :) |
|
That's fixed as well now, thanks! |
Hi, this PR adds a lexer for Gleam, which just released version
1.0.0.I've run tests and things look good to me. However, I'm not a Python person and haven't tried writing a lexer before, particularly not one for Pygments, so I'm happy to take feedback and suggestions for improvements.
There is some example HTML at https://red-rose.com/gleam.html that I generated with
pygmentizeand then modified to add thelightbulbstyle (slightly modified for Name colours). This is the same large example file that's included with the PR.Cheers,
Daren