-
Notifications
You must be signed in to change notification settings - Fork 663
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 PortugolLexer #2300
Conversation
This looks like lots of copy/paste from |
It's because Portugol doesn't understand Delphi's or Pascal's reserved words |
That should not be a problem. Just change |
Some differences:
Still do you think it's better to put portugol in DelphiLexer? A bit afraid is to appear several |
Yes, this is a lot of code duplication and I'd really prefer not to.
You can use |
@jean-abou-samra , ok. How can I pass this parameter to the Lexer |
|
It's because when running the tests I don't know how to pass this parameter.
And every time the user uses it, will he have to pass this parameter? For example, in mkdocs material ```portugol(portugol=true) // My code https://squidfunk.github.io/mkdocs-material/reference/code-blocks/ |
Well, that's true. OTOH, you can do class PortugolLexer:
name = 'Portugol'
aliases = ['portugol']
# etc. (mimetypes, filenames)
def __new__(cls, *args, **kwargs):
return DelphiLexer(*args, **kwargs, portugol=True) and that will make the lexer available as a normal lexer class and enable the |
Perfect! Do you recommend me putting it in the same file or creating a file just for Portugol Lexer as a Delphi inheritor? |
In the same file, as it's just a wrapper. |
@jean-abou-samra , thanks! |
Thanks for the update, looks much better now. I'll do some touch-ups. |
I thank you. Can you tell me when the next release will be? I'm very excited to use |
I don't think there is a date set in stone yet. You can always install the latest version from source using
|
Portugol don't have a extensive documentation, so I based on Pascal lexer and the manual of Visualg that is a program that's implements the Portugol.
issue #2299