1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-02-15 13:33:12 +02:00

447 Commits

Author SHA1 Message Date
Alec Thomas
c4527e8d5c fix: C++ comments after #include
Fixes #841
2023-09-09 13:08:27 +10:00
Alec Thomas
40542a6255 refactor: migrate a bunch more Go-based lexers to XML
Also rename some existing XML lexers to their canonical XML name.
2023-09-09 12:29:23 +10:00
Alec Thomas
4dd2cbef84 fix: bump to latest dclark/regexp2
Fixes #805
2023-09-09 11:46:52 +10:00
SerHack
a242abf7af
Highlights numbers in java (#703) 2023-09-09 11:39:30 +10:00
Alan Hamlett
340fd85fd2
Add more hlsl file extensions (#823)
To match GitHub's linguist 916bd8f3df/lib/linguist/languages.yml (L2623)
2023-09-09 11:37:13 +10:00
rome-user
67983f9b27
Update clojure.xml to target EDN (#825)
These changes allow EDN files, together with the commonly used
`application/edn` MIME type, to be highlighted as Clojure syntax.
2023-09-09 11:36:58 +10:00
Andrew Moore
6428fb4e65
Added updated GDScript lexer. (#842) 2023-09-05 07:33:36 +10:00
Carlos Henrique Guardão Gandarez
4796a27270
Set priority for NASM lexer (#839) 2023-08-27 07:56:57 +10:00
Carlos Henrique Guardão Gandarez
be65257e7e
Set priority for INI lexer over Inform 6 (#837) 2023-08-25 10:32:44 +10:00
Carlos Henrique Guardão Gandarez
b5487f4e33
Fix Bash Session lexer name (#840) 2023-08-25 10:27:31 +10:00
Carlos Henrique Guardão Gandarez
c03a781c57
Set priority for GAS lexer (#838) 2023-08-24 23:49:26 +10:00
Carlos Henrique Guardão Gandarez
0fe72e12f1
Add new file extensions to Mathematica lexer (#836) 2023-08-24 23:46:43 +10:00
Carlos Henrique Guardão Gandarez
5b26de04bf
Add missing *.twig file extension (#833) 2023-08-24 11:45:43 +10:00
Carlos Henrique Guardão Gandarez
967600379d
R lexer has priority over Rebol (#835) 2023-08-24 11:45:24 +10:00
Carlos Henrique Guardão Gandarez
708662a581
feat: improve regex analysers in XML (#831) 2023-08-23 11:51:13 +10:00
Eli Bendersky
c11725d832
Add new Go 1.21 builtins to the Go lexer: clear, min, max (#829) 2023-08-23 06:35:37 +10:00
Alec Thomas
47ce9a21b1 fix: vim lexer was marking \n as errors
Fixes #827
2023-08-22 08:39:01 +10:00
Alec Thomas
a20cd7e8df
feat: support basic regex analysers in XML (#828)
The `<analyse>` element contains a regex to match against the input, and
a score if the pattern matches.

The scores of all matching patterns for a lexer are summed.

Replaces #815, #813 and #826.
2023-08-22 05:32:23 +10:00
Carlos Henrique Guardão Gandarez
22266635c1
Fix ISCdhcpd filename (#822) 2023-08-19 08:34:51 +10:00
Carlos Henrique Guardão Gandarez
7d74956fb2
Add Pipfile and poetry.lock as a TOML lexer file extension (#821) 2023-08-19 07:02:21 +10:00
Carlos Henrique Guardão Gandarez
42d6da2d90
Add .eex as a Elixir lexer file extension (#820) 2023-08-19 07:01:46 +10:00
Carlos Henrique Guardão Gandarez
b786c3fa60
Add .tpp as a c++ lexer file extension (#817) 2023-08-18 23:02:13 +10:00
Carlos Henrique Guardão Gandarez
de3a9c2ec5
Add C lexer (#815) 2023-08-18 22:44:35 +10:00
Carlos Henrique Guardão Gandarez
49b5f8eb34
Add missing C++ tests (#814) 2023-08-18 22:41:54 +10:00
Carlos Henrique Guardão Gandarez
e6de3d1f1a
Add CPP lexer (#813) 2023-08-18 12:54:52 +10:00
Alan Hamlett
68d976f00b
Prevent panic from hax lexer (#812)
Prevents `runtime error: slice bounds out of range` when list is empty.
2023-08-16 07:50:03 +10:00
Christian Woltering
2aad7403e6
Update C# lexer (#811)
* Fix CommentPreproc regex (and update corresponding test)

* Separate KeywordDeclaration and KeywordConstant from Keyword list (similar to Java lexer).

* Update csharp lexer tests.

* Remove duplicate keyword 'static' from csharp lexer.
2023-08-16 07:46:32 +10:00
Guillaume Laforge
95cec3b2df
Update groovy.xml (#807)
Added var as an alternative to def
Now enum, trait, record, are types just like class and interface
2023-08-03 18:21:07 +10:00
Dustin
555bb53ad9
Add Lexer for Sourcepawn (#804) 2023-07-22 08:57:19 +10:00
Ian Simonson
b8c853d742
Fix attributes and <, > in Odin Lexer (#803) 2023-07-21 10:26:33 +10:00
Ian Simonson
e1e698df6d
Add Odin lexer (#802)
* Add Odin lexer

Adds the odin.xml rules for a lexer along with odin.actual and
odin.expected

Should handle the majority of Odin syntax well enough including nested comments.
However for now I have just left attributes as one token rather than sub-parsing
the @(x = y) to be multiple tokens

* Revert hlsl, natural, and vhs.expected back to master

These upated when I was generating odin.expected. I am
not sure if it is better to update these as well or leave it
so I figured I would leave for now

* Add the sized bool types and all the big/little endian int types

Odin has a number of other built in integer types that are not
in most other languages. Make sure those are included
2023-07-20 07:51:54 +10:00
guangwu
b9a63eb4f0
chore: remove refs to deprecated io/ioutil (#798) 2023-07-10 18:42:01 +10:00
executter
971f5c6a5d
Add file support for BIND DNS Zone (#796)
Support for .zone extension:
https://en.wikipedia.org/wiki/Zone_file
2023-06-30 21:19:21 +10:00
Simran
e8acfc274c
Add lexer for ArangoDB Query Language (AQL) (#794)
* Add ArangoDB Query Language (AQL) lexer
2023-06-30 08:43:39 +10:00
Dave VanEe
e422a6286f Add tal (uxntal) lexer 2023-05-05 13:39:45 +10:00
Vladimir Panteleev
4b11965d8e lexers/d: Update keyword lists 2023-05-03 12:25:39 +10:00
Skyler
be82a0bffd improve PSL directive and function highlighting 2023-05-03 11:37:11 +10:00
yhw
3c21942824 support http response with no reason phrase 2023-04-09 16:17:40 +10:00
Abdurrahman Aborazmeh
029798b351 Add AutoIt Lexer 2023-04-03 18:34:24 -07:00
Abdurrahman Aborazmeh
4779f9035a Add AutoHotkey lexer 2023-04-03 18:34:24 -07:00
Joe Mooring
e09e498ede
lexers/go_template: Add missing global functions (#782)
See https://pkg.go.dev/text/template#hdr-Functions
2023-04-03 16:34:54 -07:00
David Neto
dcc587e978
wgsl: Fix typo for texel format rgba16float (#779)
Add tests for predeclared types, type-generators, texel formats.
2023-03-28 13:18:56 -07:00
Miek Gieben
8588e37b62
Update iscdhcp xml file (#778)
This updates the ISC dhcp XML lexer. It:

- Fixes functions in function by removed the arglist state, this make
  NameFunction tokens work.
- Adds KeywordType for more words that can open a brace delimited
  section.
- Remove another set of Keyword so that they become NameVariables

Note on that latter point, from what I could scrape together from the
dhcp manual pages is that there exist 150+ directives/keywords in that
syntax, I pondered adding them all, but there lays madness, so sort of
took the middle ground, in the hopes it is useful enough to other folks

Signed-off-by: Miek Gieben <miek@miek.nl>
2023-03-27 13:38:06 -07:00
David Neto
0eecb2ae57
Add WebGPU Shading Language lexer (#776)
https://w3.org/TR/WGSL

Generated from the Pygments lexer I wrote, in
https://github.com/pygments/pygments/pull/2386
2023-03-26 13:19:09 -07:00
ifNil
4f02bc5f68
support HTTP/2 and HTTP/3 (#774) 2023-03-25 15:08:11 -07:00
Miek Gieben
357f0cbe40
dhcpd (#772)
* Add ISC dhcp config lexer

This adds a lexer to parse ISC's dhcpd.conf, https://www.isc.org/dhcp/,
this is EOL, but distributions still carry it.

It has the keywords that I could find and takes some liberty with
LiteralNumber* tokens to return IP, network and MAC addresses.

It may be possible to make this somewhat smaller, but haven't pushed for
that yet.

Signed-off-by: Miek Gieben <miek@miek.nl>

* revert some non-related changes

Signed-off-by: Miek Gieben <miek@miek.nl>

* revert

Signed-off-by: Miek Gieben <miek@miek.nl>

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
2023-03-24 02:58:31 -07:00
Kenneth Jenkins
2672d3c4c3
Add Smali lexer (#765)
Converted from the pygments Smali lexer. Add a basic test case and
update the 'Supported languages' table in the README.
2023-03-23 11:59:08 -07:00
Miek Gieben
f99570764c
cfengine3 xml: add $(..) to match NameVariable (#768)
$(...) is a valid syntax (believe called nakedvar) that should also be
matched by the CFEngine3 lexer.

Fixes: #767

Signed-off-by: Miek Gieben <miek@miek.nl>
2023-03-17 12:01:29 -07:00
Miek Gieben
cc132eda75
cfengine3 (#766)
* Fix CommentPreproc

Macros (i.e.) CommentPreproc need to be anchored as they are only
allowed to be put on the start of the line. This also solved the
conflict with nakedvar @(....).

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix NameClass

NameClass (`xxx::`) can _also_ contain variables, so add " and $ to the
allowed list in the regexp. This now also needs to be put earlier to
match before any strings.

Signed-off-by: Miek Gieben <miek@miek.nl>

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
2023-03-17 00:08:27 -07:00
Guillaume Laforge
b831d1b861
Groovy added a 'record' type and keyword in version 4 (#764) 2023-03-15 12:33:01 -07:00