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

Lexer for the Beef programming language #994

Closed
1 task done
Booklordofthedings opened this issue Aug 27, 2024 · 1 comment
Closed
1 task done

Lexer for the Beef programming language #994

Booklordofthedings opened this issue Aug 27, 2024 · 1 comment
Labels
help wanted lexer missing Missing a lexer, please contribute

Comments

@Booklordofthedings
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

What is the missing lexer?

I would like support for Beef Github.
The language syntax itself is relativly similar to c# to the point where the current language highlighting for Github just uses the C# one which would also be fine here imo.

The main reason I want support is because the file ending overlaps with brainfuck and as such Beef files often end up with no syntax highlighting at all see:
https://code.booklordofthe.dev/Booklordofthedings/Bofa/src/branch/main/src/BofaParser.bf

I could probably implement support for Beef myself if necessary.

Links to existing syntax definitions

https://github.com/github-linguist/linguist/tree/master/vendor
Its in the list and just using the default C# highlighting

@Booklordofthedings Booklordofthedings added help wanted lexer missing Missing a lexer, please contribute labels Aug 27, 2024
alecthomas pushed a commit that referenced this issue Aug 27, 2024
This adds #994 Beeflang.
The syntax itself is just a modifed version of c# with a few keywords
added or removed.
Also Ive added a test and run the test until it worked.

I am unsure if the mime_type is relevant to keep in there since I dont
know where that actually used.
Another thing im unsure of is how the selection of what language/syntax
to use for a file actually works aka:
Does this actually choose Beef syntax highlighting over Brainfuck if its
used on a beef (.bf) file ?
for that I would probably need help.

Co-authored-by: Booklordofthedings <[email protected]>
@Booklordofthedings
Copy link
Contributor Author

image
Ive tested the individual match get and analyse functions.
Get works normally.
Match only matches Beef and never Brainfuck, but I doubt that there is anyone using brainfuck that would be actually impacted by this.
Analyse doesnt seem to match, but I havent really gotten that to match for many other languages either so its probably fine.

Overall my pr was probably enough to be able to close this now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted lexer missing Missing a lexer, please contribute
Projects
None yet
Development

No branches or pull requests

1 participant