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

Refactor + propagate_positions now accepts a filter predicate. #932

Merged
merged 5 commits into from
Jul 5, 2021

Conversation

erezsh
Copy link
Member

@erezsh erezsh commented Jul 1, 2021

No description provided.

@@ -248,40 +251,54 @@ def _create_unless(terminals, g_regex_flags, re_, use_bytes):
if strtok.priority > retok.priority:
continue
s = strtok.pattern.value
m = re_.match(retok.pattern.to_regexp(), s, g_regex_flags)
if m and m.group(0) == s:
if s == _get_match(re_, retok.pattern.to_regexp(), s, g_regex_flags):
Copy link
Member

Choose a reason for hiding this comment

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

Why? I don't think that function improves readability.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's a slight improvement. But either way, I needed it for portability. I'm writing a standalone generator to Javascript, and the regex api is quite different in js.

Copy link
Member Author

@erezsh erezsh Jul 1, 2021

Choose a reason for hiding this comment

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

Hmm maybe I need to explain.. I'm trying to do the generation automaticly from Python, so that it keeps up with patches.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough. Anywhere I can help with that? Seems interesting.

Copy link
Member Author

Choose a reason for hiding this comment

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

How's your Javascript?

This is what I have so far: https://gist.github.com/erezsh/f0745a48f8a7f8a6b6375e798ec7dbfa

I still have a lot of debugging ahead of me, but if you can pinpoint what needs changing, it will save me time. Ideally one for each category, since a fix to the converter will take care of the rest.

You can also help with the converter if you like, but for now there are no pending tasks, which is why debugging the js is necessary.

@erezsh erezsh merged commit eb2b0b9 into master Jul 5, 2021
@erezsh erezsh deleted the refactor_jun2021 branch July 5, 2021 09:07
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.

2 participants