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

Don't require script headers in Rebol and Red codes. #2349

Merged
merged 4 commits into from Feb 24, 2023

Conversation

Oldes
Copy link
Contributor

@Oldes Oldes commented Feb 21, 2023

Resolves: #2348

@birkenfeld
Copy link
Member

The header should still be highlighted in some way if present I suppose?

@jeanas
Copy link
Contributor

jeanas commented Feb 21, 2023

Yeah, you probably just want to add a rule default("script") at the end of the root state.

@Oldes
Copy link
Contributor Author

Oldes commented Feb 21, 2023

@birkenfeld unfortunately as there is no way to find out if the code is a complete script or just a snipped of it, the header may not be highlighted how it was. Because one could have such an input:

switch language [
    Rebol [ print "bla" ]
    Perl  [ print "foo" ]
]

It is currently also broken.

But as the header is just an ordinary Rebol data, it will be highlighted too... the only difference is, that what is before header in a complete script will not be handled like a comment.

@birkenfeld
Copy link
Member

OK, makes sense. Just one nit: please remove the unneeded code instead of commenting.

@Oldes
Copy link
Contributor Author

Oldes commented Feb 24, 2023

@birkenfeld the code is removed now.

@birkenfeld
Copy link
Member

Thanks!

@birkenfeld birkenfeld merged commit 79db0b3 into pygments:master Feb 24, 2023
@Anteru Anteru added this to the 2.15.0 milestone Mar 25, 2023
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.

Current implementation of Rebol code coloriser is not suitable for code snippets
4 participants