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

845 Commits

Author SHA1 Message Date
Alec Thomas
bd47355e46 fix: include compress state in style cache key
Fixes #945
v2.13.0
2024-03-12 17:08:58 +11:00
renovate[bot]
1235bbf2ce
chore(deps): update all non-major dependencies (#944) 2024-03-11 12:07:17 +11:00
Gusted
4e60c816eb
C#: Allow for empty comments (#943) 2024-03-04 11:01:17 +11:00
Andrzej Lichnerowicz
fe5dde8cf4
Add Lexer for NDISASM (#933)
The Netwide Disassembler outputs text that is assembly prefixed with
memory offsets and opcode bytes.
2024-02-28 00:17:29 +11:00
Alec Thomas
6dd9f269ef
feat: introduce a LRU compiled style cache for the HTML formatter (#938)
```
🐚 ~/dev/chroma $ benchcmp before.txt after.txt
benchmark                    old ns/op     new ns/op     delta
BenchmarkHTMLFormatter-8     160560        77797         -51.55%

benchmark                    old allocs     new allocs     delta
BenchmarkHTMLFormatter-8     1267           459            -63.77%

benchmark                    old bytes     new bytes     delta
BenchmarkHTMLFormatter-8     52568         25067         -52.32%
```
2024-02-27 17:05:08 +11:00
Paul Jolly
898d467079
lexers/cue: support definitions and dollars in field names (#935)
'$' is valid in a bare field name in CUE. It is not special. It happens
to be used by convention at the start of field names, but that is about
it.

Definitions start with '#'.

Add a "section" of tests that cover the various types of field. There
are no errors in new "tests", whereas before (i.e. without the change to
the CUE lexer) there would have been.
2024-02-27 07:45:59 +11:00
renovate[bot]
0f92de4f03
chore(deps): update all non-major dependencies (#934)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-26 11:36:44 +11:00
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
renovate[bot]
e9292e6994
chore(deps): update dependency goreleaser to v1.24.0 (#925)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-15 11:10:40 +11:00
Alec Thomas
ddbae13883 chore: upgrade Go 2024-02-15 07:49:15 +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
Alec Thomas
f4788c0e9e docs: add import to README 2024-02-05 09:04:25 +11:00
renovate[bot]
39115ebe5c
chore(deps): update dependency esbuild to v0.20.0 (#921)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-29 12:25:12 +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
renovate[bot]
d7a7dd3331
chore(deps): update module github.com/alecthomas/assert/v2 to v2.5.0 (#917)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-22 15:27:26 +11:00
renovate[bot]
c31293c797
chore(deps): update dependency go to v1.21.6 (#915)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-15 14:47:28 +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
renovate[bot]
3ef9475e0b
chore(deps): update dependency watchexec to v1.25.1 (#912)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-08 12:15:10 +11:00
Aniket Teredesai
23368beae6
styles(catpuccin/gh-dark): LineHighlight grp (#911) 2024-01-07 09:23:23 +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
renovate[bot]
3f395c95ef
chore(deps): update all non-major dependencies (#905)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-01 15:08:31 +11:00
renovate[bot]
2018c2fa21
chore(deps): update all non-major dependencies (#904) 2023-12-25 13:32:55 +11:00
JakobDev
016768bc14
Add desktop entry lexer (#903) 2023-12-19 22:44:28 +11:00
renovate[bot]
f13004523b
chore(deps): update dependency watchexec to v1.24.1 (#901)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-18 12:43:06 +11:00
renovate[bot]
9670d341cc
chore(deps): update actions/checkout action to v4 (#899)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-11 14:39:33 +11:00
renovate[bot]
ad038174d4
chore(deps): update all non-major dependencies (#898)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-11 14:38:07 +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
Alec Thomas
c74f557ed2 Add renovate v2.12.0 2023-12-02 07:26:45 +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
Alec Thomas
96a12e377e fix: bad path normalisation v2.11.1 2023-11-13 08:41:30 +11:00
Alec Thomas
09953ff50f fix: attempt to load lexer files before using Get()
File loading runs after Get(), but Get() always succeeds so it would
never load a file.
v2.11.0
2023-11-13 08:22:22 +11:00
eric-j-ason
fe96ea49ef
Add test for ucode (#881) v2.10.1 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
038fab58f6
Add shebang (#864) 2023-11-01 07:18:04 +11:00
Jonathan
48d6be607a
Update prql.xml (#878) 2023-11-01 06:28:48 +11:00
otbutz
810464a509
Update Java lexer (#873) v2.10.0 2023-10-26 20:34:50 +11:00