-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
lookbehind: true | ||
}, | ||
|
||
'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1|(^#?(?:(?:[0-9a-fA-F]{2}){3}|(?:[0-9a-fA-F]){3})$)/, |
There was a problem hiding this comment.
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.
Thanks for contributing! Please take a look at my comments. |
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|$)/, |
There was a problem hiding this comment.
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.
I spotted two other little things. Also, could you add an example file to this PR, following the format used by the existing ones. |
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/, |
There was a problem hiding this comment.
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 \/
Thanks, it looks quite good to me now. |
Hey guys, anything left I can do to get this PR merged? |
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 |
Ren'py is a Visual Novel engine. This syntax highlightning has been built using the documentation available from Ren'py