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

484 Commits

Author SHA1 Message Date
Francis Lavoie
381050ba00
Major updates to Caddyfile lexer (#932)
* Major updates to Caddyfile lexer

* yaml editorconfig

* nolint false positive
2024-02-20 20:08:27 +11:00
W. Michael Petullo
7ce2caf57a
Fix lexers check when built with newer Go (#928)
Newer versions of Go emit '\f' rather than "\u000c" for formfeeds. This
patch adjusts the expected values for the lexers tests to match.

Fixes: https://github.com/alecthomas/chroma/issues/927

See also: https://github.com/golang/go/issues/64346 for the change to
Go.

Signed-off-by: W. Michael Petullo <mike@flyn.org>
2024-02-15 07:37:06 +11:00
Abhinav Gupta
506e36f9e0
fix(lexers/go): "~" is a valid token (#926)
With the introduction of generics,
tilde is a valid punctuation token in Go programs.
https://go.dev/ref/spec#Operators_and_punctuation

This updates the punctuation regex for the Go lexer,
and adds a test to ensure that it's treated as such.
2024-02-12 14:51:38 +11:00
silverwind
4c6fdb1d11
Add .avsc to JSON lexer (#920) 2024-01-26 07:20:16 +11:00
Jamie Tanna
ee60f7e738
Add missing token types for Rego + add Rego to README (#919) 2024-01-24 07:45:58 +11:00
Jamie Tanna
ae36e63369
Add support for Rego syntax (#918) 2024-01-23 08:01:11 +11:00
Luke Marzen
ebc34cf4aa
fix file extension typo, remove redundent parens (#914) 2024-01-15 11:26:41 +11:00
Philipp Hagenlocher
641b06ff8c
Fix type operators not being recognised in Haskell (#913) 2024-01-09 12:20:39 +11:00
Silvan Calarco
a8704a8f0b
Add lexer for RPMSpec (#907) 2024-01-03 08:45:31 +11:00
Luke Marzen
eb47752470
Add lexer for Promela (#906) 2024-01-02 16:11:09 +11:00
JakobDev
016768bc14
Add desktop entry lexer (#903) 2023-12-19 22:44:28 +11:00
renovate[bot]
76039a532f
chore(deps): update all non-major dependencies (#897)
* chore(deps): update all non-major dependencies

* fix: fixes for test and lint

Test was slow because we were deep-comparing lexers. This is
unnecessary as we can just shallow compare.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Alec Thomas <alec@swapoff.org>
2023-12-08 14:22:40 +11:00
Aru Sahni
678b799ad6
Add a lexer for the Materialize SQL dialect (#896) 2023-12-08 11:21:23 +11:00
Mohammed Anas
d77dc8ab51
Add Hare lexer (#882) 2023-11-29 10:00:30 +11:00
Daniel
234600703b
Add an Alloy lexer (#892) 2023-11-26 08:52:31 +11:00
Daniel
08be6f023f
Add an Agda lexer (#891) 2023-11-25 19:54:04 +11:00
codiacdev
d9f6ed634e
added: rule to objectpascal lexer (#888)
* added: another rule for objectpascal lexer

* updated: objectpascal lexer testdata

* fixed: processing of control (escape) characters

* updated: test data for objectpascal lexer
2023-11-24 06:53:33 +11:00
silverwind
c5948a61b1
Add Vagrantfile to Ruby lexer (#890) 2023-11-24 06:50:30 +11:00
Rik
7d4db86648
Add Microsoft Dax (#889) 2023-11-22 20:53:27 +11:00
codiacdev
1cda665d1b
fixed: number formats in objectpascal lexer (#887)
* fixed: number formats in objectpascal lexer

added: some missing types
added: special compiler directives

* updated: testdata for objectpascal lexer
2023-11-19 11:05:10 +11:00
tarneo
b5afdeeade
fix(dns): highlight domain names as NameClass (#886) 2023-11-18 21:58:01 +11:00
codiacdev
07a90a93dd
added: ObjectPascal lexer (#883)
Initial version (proposal) of an ObjectPascal lexer

- the assembler state is not in use yet...
- the Intrinsic Routines rule is commented out and probably not needed...
2023-11-17 10:13:06 +11:00
eric-j-ason
fe96ea49ef
Add test for ucode (#881) 2023-11-09 06:19:06 +11:00
eric-j-ason
8f938d02c5
Create lexer for ucode (#879) 2023-11-08 08:48:10 +11:00
Jonathan
48d6be607a
Update prql.xml (#878) 2023-11-01 06:28:48 +11:00
otbutz
810464a509
Update Java lexer (#873) 2023-10-26 20:34:50 +11:00
silverwind
77e9146939
Add file extensions to go_template lexer (#875) 2023-10-21 04:33:35 +11:00
silverwind
9ae4daed01
Add *.Dockerfile to docker lexer (#868) 2023-10-12 13:47:20 +11:00
Jonathan
17597b63b7
Add PRQL language (#862) 2023-10-04 02:30:36 +11:00
Watal M. Iwasaki
7eb0305e1b
lexers/r: Match keywords prior to functions (#860) 2023-09-25 19:57:51 +10:00
Paul Jolly
827bd93b8c
lexers: add initial version of CUE lexer (#858)
This commit adds a decent first-cut of a lexer for CUE
(https://cuelang.org).

The main aspects of the language are implemented, but there are likely a
number of edge cases not covered, especially when it comes to string
interpolation, but this is a sufficiently decent first cut so as to
warrant merging into the chroma project rather than first working in a
fork.

This was tested locally for visual correctness using

    mkdir -p _examples
    (command cd ./cmd/chroma; go run . --lexer=cue --html --html-inline-styles) < lexers/testdata/cue.actual > _examples/cue.html

and then loading _examples/cue.html in a browser.

Closes #857
2023-09-24 08:12:43 +10:00
Alec Thomas
9087c632c4 docs: note about Get() being slow due to file matching
Fixes #714
2023-09-22 07:00:14 +10:00
Paul Jolly
ccd8d68495
lexers: move to comparing bytes in tests (#856)
* test: fix up writing up float scores with trailing newlines

This ensures we consistently write a trailing newline when RECORD=true
is set.

* lexers: update expected files using proper newlines

This is the mechanical result of running:

    RECORD=true go test ./lexers

* Assert lexer tests based on equality of byte encodings

This helps to ensure that running RECORD=true go test ./lexers on a
given commit for which the tests pass will not result in any changes in
the working tree.

Notes that as a result of this change, the following command results in
a clean working tree:

    RECORD=true go test ./lexers

Fixes #855
2023-09-22 06:35:48 +10:00
Rupus Reinefjord
0b08639048
lexers: support for nim GENERALIZED_TRIPLESTR_LIT (#853) 2023-09-19 23:20:40 +10:00
Anthony Martin
94d11ab996
Update Bicep grammar with recent additions (#850) 2023-09-17 08:29:47 +10:00
silverwind
c64e1bea46
add justfile filename to Makefile lexer (#852) 2023-09-17 08:25:01 +10:00
Carlos Henrique Guardão Gandarez
2b394614b7
Fix GDScript3 analyse regexes (#848) 2023-09-16 13:52:47 +10:00
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