Adding basic Mojo lexer by hroemer · Pull Request #2691 · pygments/pygments

@hroemer

basic implementation for #2515 based upon PythonLexer

@hroemer

@hroemer

@Anteru

@hroemer

Thanks for guiding me along. I tested it locally (e.g. pygments -O full,style=emacs,linenos=1 -o test.html ...) and unfortunately was in a little rush here not reading the docs. I will add an according test file and output in the next couple of days, hopefully doing it more properly that time.

@hroemer

@Anteru I am currently struggling with tox. The command mentioned in the docs is not working out for me. I get tox: error: unrecognized arguments: --update-goldens. It works when adding the run command, but I cannot reason about the output, yet.

I guess I need to dig more into tox / pygments.

One general question as I don't have any experience with tox, but have done snapshot based testing (pytest / jest) in the past. Are the lexer tests similar to that?

Cheers

@jeanas

The command mentioned in the docs is not working out for me. I get tox: error: unrecognized arguments: --update-goldens.

It's tox -- --update-goldens, mind the extra --.

One general question as I don't have any experience with tox, but have done snapshot based testing (pytest / jest) in the past. Are the lexer tests similar to that?

Yes. And they're done with pytest, tox is just a test runner which saves you the time to install pytest in a virtual environment.

@hroemer

@hroemer

@hroemer

Thanks for your quick response and sorry for the delay. Github's device verification currently has a massive delay for emails. Login failed for 2 days now.

Actually I did use the double-dash, but I wasn't aware of tox automatic venv handling.
Thus, running tox "inside" another venv (PDM) didn't work out well.

Anyway, I got it working now and prepared snippets / examples.

@Anteru

@Anteru Anteru linked an issue

Apr 27, 2024

that may be closed by this pull request