1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-03-19 21:10:15 +02:00

6 Commits

Author SHA1 Message Date
Martin Stühmer
4c36740e5e
Refinement of the C# lexer (#563) 2021-10-21 14:03:33 +11:00
Cameron Moore
59126c5b32
Add NewLazyLexer to defer rules definitions and reduce init costs (#449)
Add NewLazyLexer and MustNewLazyLexer which accept a function that
returns the rules for the lexer.  This allows us to defer the rules
definitions until they're needed.

Lexers in a, g, s, and x packages have been updated to use the new lazy
lexer.
2021-02-08 12:16:49 +11:00
Steven Penny
881d54f096 Improve number literals for several languages
Using these examples:

~~~
0x21
1_000
1e3
~~~

Several languages failed that support these syntax. Here are ones I found:

Lexer      | 0x21 | 1_000 | 1e3
-----------|------|-------|-----
C#         | fail | fail  | fail
Go         |      | fail  |
JavaScript |      | fail  | fail
PHP        |      | fail  |
Python     |      | fail  |
Ruby       |      |       | fail

I fixed these issues, and added tests.
2020-11-22 08:30:29 +11:00
Jos512
8ce6ac6016 Enable EnsureNL for TradingView and C# lexers 2019-01-23 20:30:40 +11:00
Alec Thomas
5640f893f2 Revert #78.
See #68.
2018-03-19 17:26:42 +11:00
Alec Thomas
563aadc53c Moved lexers into alphabetical sub-packages.
This was done to speed up incremental compilation when working on
lexers. That is, modifying a single lexer will no longer require
recompiling all lexers.

This is a (slightly) backwards breaking change in that lexers are no
longer exported directly in the lexers package. The registry API is
"aliased" at the old location.
2018-02-15 21:09:02 +11:00