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

Add support for Zig #1470

Merged
merged 3 commits into from
Jan 2, 2021
Merged

Add support for Zig #1470

merged 3 commits into from
Jan 2, 2021

Conversation

paulsmith
Copy link
Contributor

Adds syntax support for source code for the Zig programming language.

image

Adds syntax support for source code for the Zig programming
language. https://ziglang.org/
@sharkdp
Copy link
Owner

sharkdp commented Jan 2, 2021

Thank you very much for your contribution!

I added the instructions for adding syntax tests just today, and I did forget to mention a peculiarity when creating syntax tests for a new syntax. You actually first need a version of bat that has the new Zig syntax builtin. This means that you have to run bash assets/create.sh and then recompile bat. I will update the tests for you (and update the documentation).

@sharkdp sharkdp merged commit b3f3452 into sharkdp:master Jan 2, 2021
sharkdp added a commit that referenced this pull request Jan 2, 2021
@moderation
Copy link

@paulsmith Awesome to see Zig support land. However I just compiled from the main branch and Zig support not available. bat -L | rg -i zig doesn't return anything and

bat -l zig ~/Downloads/hello.zig
[bat error]: unknown syntax: 'zig'

Does Zig support need to be enabled in some way? Any chance it isn't working as I'm compiling with musl - cargo build --release --verbose --target x86_64-unknown-linux-musl. I've confirmed Zig support isn't working on MacOS and Linux aarch64 too.

@sharkdp
Copy link
Owner

sharkdp commented Jan 2, 2021

@moderation Until we release the next version, you need to manually generate the new builtin syntax set:

  • make sure that all submodules are checked out as well
  • compile bat
  • run bash assets/create.sh
  • compile bat again.

@moderation
Copy link

@sharkdp that worked great. Thanks

@sharkdp
Copy link
Owner

sharkdp commented Feb 28, 2021

Added in bat v0.18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants