1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-01-26 03:20:10 +02:00

853 Commits

Author SHA1 Message Date
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
Toshimaru
9864526122
deps: update go modules (#810) 2023-08-13 10:46:59 +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
b8ad4d6cab
chore: unnecessary use of fmt.Sprintf (#799) 2023-07-10 18:42:13 +10:00
guangwu
b9a63eb4f0
chore: remove refs to deprecated io/ioutil (#798) 2023-07-10 18:42:01 +10:00
Aniket Teredesai
0e7ec95a1d
styles/catppuccin-*: update colors (#797) 2023-07-06 07:30:02 +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
v2.8.0
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
Alexandru Bucur
bf8d359499 FIX: update nord theme to have a base color for NameProperty
Right now there is no value for NameProperty making .chroma .py to be empty.

Because of that there are cases in which the color is wrongly used because it's not overwritten (for eg: when trying to use a light theme as the main one, and Nord under prefers-color-scheme: dark .

This sets the color to match the one from the theme preview that is applied for the methods
2023-05-02 07:16:31 +10:00
Alexandru Bucur
f720d5a474 FIX: update nord theme to have a base color for NameOther
Right now there is no value for NameOther making .chroma .nx to be empty.

Because of that there are cases in which the color is wrongly used because it's not overwritten (for eg: when trying to use a light theme as the main one, and Nord under prefers-color-scheme: dark .

This MR sets the color to match the one from the theme preview.
2023-05-01 07:17:34 +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
7c08f459bd
Update the main README to point to the lexers/README (#777)
This will make it clearer where the tests are.
When I first contributed I didn't see past the "try it with chromad" instructions.
2023-03-26 15:02:17 -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
Alec Thomas
b9e3758120 Upgrade goreleaser. v2.7.0 2023-03-21 13:55:45 +11: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>
v2.6.0
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
Alec Thomas
7e30655df1 Allow custom XML lexers and styles to be loaded from the command-line. 2023-03-17 10:21:26 +11:00
Alec Thomas
0d91785454 Upgrade go + golangci-lint 2023-03-17 09:06:10 +11:00
Guillaume Laforge
b831d1b861
Groovy added a 'record' type and keyword in version 4 (#764) 2023-03-15 12:33:01 -07:00
Siavash Askari Nasr
42c314dbe7
Raku: Change the token type of builtin types to KeywordType (#759) 2023-03-04 17:12:50 +11:00
JakobDev
96a518bb94
[Python]Add match and case to Keywords (#756) 2023-03-03 05:14:44 -08:00
JakobDev
ecb69ce50b
Add Note about testing lexers to Readme (#757) 2023-03-03 05:13:26 -08:00
JakobDev
31310888c4
Fix Playground on Windows (#758) 2023-03-03 04:52:55 -08:00
Joe Mooring
22f3c60f3a
styles/vulcan: Fix background color (#753) 2023-02-26 10:23:55 +11:00
Peter Marheine
ba01b927d3
Add support for Z80 assembly (#751)
This handles most Z80 instructions and commonly-used assembler
directives, but does not impose much structure beyond recognizing those
items.
2023-02-20 23:05:35 -08:00
Austin Eccentrici
3ac94eea73
Add HolyC support (#750) 2023-02-14 23:40:04 -08:00
gempir
1d0ed7f62a increase php priority over phtml
currently phtml takes priority over php, that's odd considering phtml is not very common anymore compared to php
2023-02-12 12:09:33 +11:00
Markus Amshove
a40c95e447 Add support for Natural language 2023-02-08 10:15:33 +11:00
Lovecraftian Horror
4bfa1bbb7c Rust: Add initial support for string interpolation v2.5.0 2023-01-31 13:23:29 +11:00
CosmicHorror
f5f48e206a
Rust: Generalize declaritive and function-like macros (#742) 2023-01-29 19:55:50 -08:00
CosmicHorror
55b0e59213
Rust: Attempt to lex constant idents (#741) 2023-01-30 06:27:19 +11:00
CosmicHorror
87869f8477
Fix rust byte char capture (#740) 2023-01-30 05:37:51 +11:00
CosmicHorror
0ea6503487
Rust: Include starting apostrophe in lifetime / loop label token (#739) 2023-01-29 16:02:56 +11:00
Itamar Haber
633f8e0f55 Removes 'tabindex="0"' from `<pre>' elements 2023-01-20 02:03:49 +11:00