-
Notifications
You must be signed in to change notification settings - Fork 73
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
[SM64] Fix persistent block spam #434
Conversation
[^()]* | ||
.*? # match as few chars as possible before macro name | ||
(?P<macro_name>\w+) #group macro name matches 1+ word chars | ||
\s* # allows any number of spaces after macro name |
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.
could you make this lazy (was causing extra steps according to the debugger)
\s* # allows any number of spaces after macro name | |
\s*? # allows any number of spaces after macro name |
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 deleted my last comments and rethought my own suggestions, tell me what you think
(\s*,\s*|\s*) | ||
(?P<comment> | ||
//.*$ | ||
(\s*,\s*|\s*) # group of whitespace and comma and whitespace (??) |
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.
(\s*,\s*|\s*) # group of whitespace and comma and whitespace (??) | |
(\s*?,)?[^\n]*? # capture a comma, including white space trailing except for new lines following the comma |
//.*$ | ||
(\s*,\s*|\s*) # group of whitespace and comma and whitespace (??) | ||
(?P<comment> # comment group | ||
([^\n]|\s*?\\\s*?\n)//.*$ # two // and any number of chars and str or line end |
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.
([^\n]|\s*?\\\s*?\n)//.*$ # two // and any number of chars and str or line end | |
([^\n]*?|\s*?\\\s*?\n)//.*$ # two // and any number of chars and str or line end |
| | ||
/\*.*\*/ | ||
)? | ||
([^\n]|\s*?\\\s*?\n)/\*.*\*/ # a /*, any number of chars and a */ |
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.
([^\n]|\s*?\\\s*?\n)/\*.*\*/ # a /*, any number of chars and a */ | |
([^\n]*?|\s*?\\\s*?\n)/\*[\s\S]*?\*/ # a /*, any number of chars (including new line) and a */ |
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.
Works!
macros were parsing comments even though they were on a new line, so I made the macro not see a comment with a newline character unless there was a backslash