Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More extensible syntax mapping mechanism #2755

Merged
merged 49 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9ca1f20
Add specification draft
cyqsimon Oct 31, 2023
f705fcb
Add global git-config example
cyqsimon Oct 31, 2023
8328697
Add ordering prefix to git-config example
cyqsimon Oct 31, 2023
37fd050
Describe filename ordering more accurately
cyqsimon Oct 31, 2023
52f94b4
Clarify syntax selection algorithm behaviour
cyqsimon Oct 31, 2023
d1bc0ef
Build script codegen initial impl
cyqsimon Nov 2, 2023
97780f9
`MappingDefModel::into_mapping_list` returns `MappingList`
cyqsimon Nov 2, 2023
77e4911
Ensure lexicographical ordering
cyqsimon Nov 2, 2023
9f42597
Fix codegen type declaration
cyqsimon Nov 2, 2023
d24501a
`include!` generated mappings in source
cyqsimon Nov 2, 2023
9478d2d
Isolate variables at compile time
cyqsimon Nov 2, 2023
827b3ec
Add unset `*.conf` example
cyqsimon Nov 2, 2023
64840fb
`join_segments` -> `build_glob_string`
cyqsimon Nov 2, 2023
0fea82c
Minor improvement of variable naming accuracy
cyqsimon Nov 2, 2023
9f7d70f
Use regex for matcher parsing
cyqsimon Nov 2, 2023
7cfd1e0
Rerun build script only when necessary
cyqsimon Nov 2, 2023
075b5b2
Matcher parser errors when empty
cyqsimon Nov 4, 2023
4815b61
Write changelog
cyqsimon Nov 4, 2023
7e1fbcf
Fix visibility for `SyntaxMapping::get_syntax_for`
cyqsimon Nov 4, 2023
c016b46
`STATIC_RULES` => `BUILTIN_MAPPINGS`
cyqsimon Nov 4, 2023
de6d418
Remove `BuiltinMatcher` enum
cyqsimon Nov 4, 2023
0c93ca8
Guard against duplicate matchers in build script
cyqsimon Nov 4, 2023
1c7c9a6
Split `syntax_mapping/builtin.rs`
cyqsimon Nov 4, 2023
cfd622d
Migrate `SyntaxMapping` impl to new system
cyqsimon Nov 4, 2023
4ad3002
`s/Lazy<GlobMatcher>/Lazy<Option<GlobMatcher>>/`
cyqsimon Nov 4, 2023
f483d2d
Lazily compile `GlobMatcher`s
cyqsimon Nov 4, 2023
ad628c0
Fix iterator lifetime incompatibility
cyqsimon Nov 5, 2023
822e81b
Suppress clippy warning for `MappingTarget` in build script
cyqsimon Nov 5, 2023
2c9bf22
Add doc comment for `BUILTIN_MAPPINGS`
cyqsimon Nov 5, 2023
0c1b80f
Impl per-target syntax mappings
cyqsimon Nov 5, 2023
22531ea
Port all mappings to new system
cyqsimon Nov 5, 2023
1f10d84
Fix tests
cyqsimon Nov 5, 2023
12fa2cb
`-` is not a legal character in variable name
cyqsimon Nov 5, 2023
36073a3
Document another rule ignore condition
cyqsimon Nov 5, 2023
daf3370
Additional sanity check for matcher parser
cyqsimon Nov 6, 2023
b48bda2
Add test: `all_fixed_builtin_mappings_can_compile`
cyqsimon Nov 6, 2023
9474b4c
Rename & sort syntax mapping tests
cyqsimon Nov 6, 2023
3865908
Add test: `custom_mappings_precedence`
cyqsimon Nov 6, 2023
e30161a
Add test: `builtin_mappings_matcher_only_compile_once`
cyqsimon Nov 6, 2023
586c804
Add test: `builtin_mappings_are_lazily_evaluated`
cyqsimon Nov 6, 2023
8a08025
Disable `builtin_mappings_are_lazily_evaluated` for ARM builds
cyqsimon Nov 7, 2023
d792dc5
Move `rusty-fork` to dev-dependencies
cyqsimon Nov 27, 2023
f0a6fe2
Benchmark prototype
cyqsimon Dec 11, 2023
15ab447
Reduce unnecessary build deps
cyqsimon Dec 22, 2023
e4d637a
Reverse precedence of syntax mappings specified on CLI
cyqsimon Jan 18, 2024
9f36a7a
Minor codestyle improvements
cyqsimon Jan 18, 2024
c0f2d6f
Add note on subdirectory's irrelevance to ordering
cyqsimon Jan 18, 2024
230abfd
Merge branch 'master' into syntax-mapping-refactor
cyqsimon Jan 19, 2024
55e02e1
Apply review suggestions to benchmark script
cyqsimon Jan 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,20 @@
- Minor benchmark script improvements #2768 (@cyqsimon)
- Update Arch Linux package URL in README files #2779 (@brunobell)
- Update and improve `zsh` completion, see #2772 (@okapia)
- More extensible syntax mapping mechanism #2755 (@cyqsimon)
- [BREAKING] Precedence order of user-defined syntax mappings (using `-m/--map-syntax`) has been reversed
- `-m '*.foo:alpha' -m '*.foo:bravo'` now maps `bar.foo` to `alpha`
cyqsimon marked this conversation as resolved.
Show resolved Hide resolved

## Syntaxes

## Themes

## `bat` as a library

- Changes to `syntax_mapping::SyntaxMapping` #2755 (@cyqsimon)
- `SyntaxMapping::get_syntax_for` is now correctly public
- [BREAKING] `SyntaxMapping::{empty,builtin}` are removed; use `SyntaxMapping::new` instead
- [BREAKING] `SyntaxMapping::mappings` is replaced by `SyntaxMapping::{builtin,custom,all}_mappings`

# v0.24.0

Expand Down
Loading