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

timeout for a single line parse #15

Closed
lidaobing opened this issue Mar 13, 2013 · 1 comment
Closed

timeout for a single line parse #15

lidaobing opened this issue Mar 13, 2013 · 1 comment

Comments

@lidaobing
Copy link
Contributor

consider following code, it will timeout, we should change [a-zA-Z0-9_\.()]*| to [a-zA-Z0-9_\.()]*?|

a =  /
        (\b[snN]?__)               # Matches the function call grouping the method used (__, n__, N__, etc)
          \(                         # and a parenthesis to start the arguments to the function.
            (('.*?'|                 # Then a token inside the argument list, like a single quoted string
              ".*?"|                 # ...Double quote string
              [a-zA-Z0-9_\.()]*|    # ...a number, variable name, or called function lik: 33, foo, Foo.bar()
              [ ]|                   # ...a white space
              ,)                     # ...or a comma, which separates all of the above.
            *)                       # There may be many arguments to the same function call.
          \)                         # function call closing parenthesis
      /x
b = "category_name = __('No Category') if category_name == null"
b.scan(a)
@tboerger
Copy link
Member

This issue seems to be solved. If you still have problems please reopen the issue.

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

No branches or pull requests

2 participants