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

Leading underscore in APL variable names (GNU, Dyalog) #1747

Merged
merged 3 commits into from
Mar 15, 2021

Conversation

xpqz
Copy link
Contributor

@xpqz xpqz commented Mar 12, 2021

Two small tweaks to the APL lexer

  1. Add all APL file suffixes
  2. Allow leading _ in variable names (GNU APL, Dyalog)

1. Add all APL file suffixes
2. Allow leading _ in variable names (GNU APL, Dyalog)
@rodrigogiraoserrao
Copy link

This PR is more useful than it may seem, as _← is a common idiom in APL programming.
There's also the fact that leading underscores are used commonly as the leading character of dop names.

@Anteru
Copy link
Collaborator

Anteru commented Mar 12, 2021

Thanks! Can you please regenerate the mapfiles as well (make mapfiles), otherwise the file endings won't get picked up. Would you mind adding/extending one of the APL tests to capture this as well? Not required but would be nice to have so it doesn't regress.

 1. Leading underscores for variables OK (Dyalog, GNU)
@xpqz
Copy link
Contributor Author

xpqz commented Mar 15, 2021

@Anteru Thanks for your comments. I've regenerated the mapfiles and added a testcase (there weren't many for APL...) to demonstrate the modification as per your suggestions.

@Anteru Anteru merged commit 18a1d88 into pygments:master Mar 15, 2021
@Anteru
Copy link
Collaborator

Anteru commented Mar 15, 2021

Merged, thanks a lot!

@Anteru Anteru added this to the 2.9 milestone Mar 15, 2021
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

3 participants