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

Added Ren'py language #658

Merged
merged 8 commits into from
Sep 9, 2017
Merged

Added Ren'py language #658

merged 8 commits into from
Sep 9, 2017

Conversation

Hyuchia
Copy link
Contributor

@Hyuchia Hyuchia commented Aug 9, 2015

Ren'py is a Visual Novel engine. This syntax highlightning has been built using the documentation available from Ren'py

lookbehind: true
},

'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1|(^#?(?:(?:[0-9a-fA-F]{2}){3}|(?:[0-9a-fA-F]){3})$)/,
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you really mean to use the $ anchor without the m flag? This implies those hexadecimal patterns can only appear at the very end of the code.

@Golmote
Copy link
Contributor

Golmote commented Aug 13, 2015

Thanks for contributing! Please take a look at my comments.

@Hyuchia
Copy link
Contributor Author

Hyuchia commented Aug 14, 2015

Thanks, I applied fixes for the issues. Actually the regex for hex values was not needed since they are expected to be strings.

'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1|(^#?(?:(?:[0-9a-fA-F]{2}){3}|(?:[0-9a-fA-F]){3})$)/m,

'comment': {
pattern: /(^|[^\\])#.*?(\r?\n|$)/,
Copy link
Contributor

Choose a reason for hiding this comment

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

Here the whole part .*?(\r?\n|$) can be replaced with .+, since I'm pretty sure we don't care about consuming the line feed.

@Golmote
Copy link
Contributor

Golmote commented Aug 14, 2015

I spotted two other little things.

Also, could you add an example file to this PR, following the format used by the existing ones.

@Hyuchia
Copy link
Contributor Author

Hyuchia commented Aug 16, 2015

I've added the examples file as well as simplified those expressions. Thanks!


'number' : /\b-?(0[bo])?(?:(\d|0x[a-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,

'operator' : /[-+^~%!*?]|<=?|>=?|={1,2}|&{1,2}|\|?\|\/|\b(or|and|not|with|at)\b/,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is a missing pipe between \|?\| and \/

@Golmote
Copy link
Contributor

Golmote commented Aug 16, 2015

Thanks, it looks quite good to me now.
@LeaVerou: what do you think?

@Hyuchia
Copy link
Contributor Author

Hyuchia commented Jun 14, 2017

Hey guys, anything left I can do to get this PR merged?

@Golmote Golmote merged commit 96fc9df into PrismJS:master Sep 9, 2017
@Golmote
Copy link
Contributor

Golmote commented Sep 9, 2017

Hi @Hyuchia. I'm really sorry for the long delay. Ren'py is finally merged! Thank you very much for contributing.

Actually, it would be awesome if you could write the tests for Ren'py, since I don't know anything about it. See the tests for the other languages and the Test suite page for more information about it.

Also, please make your PR against the gh-pages branch instead of the master branch.

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

2 participants