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 Arturo language #2259

Merged
merged 67 commits into from Oct 26, 2022
Merged

Conversation

RickBarretto
Copy link
Contributor

This PR adds Arturo Language highlight support. 🙂

Simple, expressive & portable programming language for efficient scripting

Arturo's Github
Arturo's Website

@RickBarretto
Copy link
Contributor Author

Sorry, I tried to use this function. (It was running on my local machine. Generating the files correctly).
But, I replaced for manual configuration, since it's breaking in CI tests.

@jeanas
Copy link
Contributor

jeanas commented Oct 24, 2022

Because you used list[tuple], which is only supported in Python 3.9+. Before that, you need to use typing.List. In any case, we don't use type annotations in our code base, and the inlined version is just as readable IMHO.

Copy link
Member

@birkenfeld birkenfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch!

A lot of comments, but nothing major.

pygments/lexers/arturo.py Outdated Show resolved Hide resolved
pygments/lexers/arturo.py Outdated Show resolved Hide resolved
pygments/lexers/arturo.py Outdated Show resolved Hide resolved
pygments/lexers/arturo.py Outdated Show resolved Hide resolved
pygments/lexers/arturo.py Show resolved Hide resolved
pygments/lexers/arturo.py Outdated Show resolved Hide resolved
pygments/lexers/arturo.py Outdated Show resolved Hide resolved
pygments/lexers/arturo.py Outdated Show resolved Hide resolved
(r'\:\w+',
Keyword.Type)
],
'attributes': [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is not used (another danger of using too many trivial states...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still a few of them (punctuation, sugar, builtin-predicate-functions, maybe more...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@birkenfeld, do you think I need to remove operators state?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"need to" is too strong, but in general states that are only used as an include once are not technically needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

pygments/lexers/arturo.py Show resolved Hide resolved
@RickBarretto RickBarretto changed the title Add support for Arturo language WIP: Add support for Arturo language Oct 25, 2022
@RickBarretto
Copy link
Contributor Author

Note: I'll test the file. Some of this changes may break something.

@RickBarretto
Copy link
Contributor Author

@birkenfeld. Can You help me with something?

So, in these lines I have string interpolation string-interpol and string templates string-templates. But, templates are working and interpol doesn't.

They are almost the same, except for the notation. Templates start with <|| and end with ||>, while interpolation starts and ends with a | only.


Templates (working well):
image

String Interpolation (broken):
image


What should I do in this case?

pygments/lexers/arturo.py Outdated Show resolved Hide resolved
pygments/lexers/arturo.py Outdated Show resolved Hide resolved
tests/examplefiles/arturo/arturo_test.art.output Outdated Show resolved Hide resolved
pygments/lexers/arturo.py Outdated Show resolved Hide resolved
@RickBarretto
Copy link
Contributor Author

RickBarretto commented Oct 26, 2022

Error:

W117: Overlap in character class: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
              (r'\b\\[\w\d]+\b\??:?',                 # array index
                     ^ here

The \w metacharacter matches word characters. A word character is a character a-z, A-Z, 0-9, including _ (underscore).

My bad! I think it'll run now!

Copy link
Member

@birkenfeld birkenfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice now, thanks!

@birkenfeld birkenfeld merged commit 0083964 into pygments:master Oct 26, 2022
@birkenfeld
Copy link
Member

Added changelog and fixed up code style a bit in a followup commit.

@celtic-coder
Copy link

Great work to all concerned! @RickBarretto, Jean (@jean-abou-samra) , Georg (@birkenfeld), Yanis (@drkameleon). Well done! 👍

@celtic-coder
Copy link

Thanks Georg (@birkenfeld) for adding 8cb16e2.

@RickBarretto
Copy link
Contributor Author

RickBarretto commented Oct 27, 2022

Also, thank you @birkenfeld for your help, reviews, comprehension and patience. 🙂
🎉 🚀

@birkenfeld
Copy link
Member

It was a pleasure :)

@RickBarretto RickBarretto changed the title WIP: Add support for Arturo language Add support for Arturo language Oct 27, 2022
@Anteru Anteru added this to the 2.14.0 milestone Dec 30, 2022
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.

None yet

6 participants