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

Pattern parse bug #668

Open
sn6uv opened this issue Jan 16, 2017 · 1 comment
Open

Pattern parse bug #668

sn6uv opened this issue Jan 16, 2017 · 1 comment
Labels

Comments

@sn6uv
Copy link
Member

sn6uv commented Jan 16, 2017

In[1]:= f[x:(_..)]
Syntax::sntxf: "f[x:(_.." cannot be followed by ")]" (line 1 of "<stdin>").

Expected f[Pattern[x, Repeated[Blank[]]]]

Traceback (most recent call last):
  File "matcher.py", line 326, in <module>
    tests.append((_parse(expr), _parse(patt), (slots, names)))
  File "matcher.py", line 269, in _parse
    return parse(definitions, SingleLineFeeder(expr_string))
  File "/home/angus/Mathics/mathics/core/parser/util.py", line 25, in parse
    ast = parser.parse(feeder)
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 39, in parse
    return self.parse_e()
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 76, in parse_e
    result.append(self.parse_exp(0))
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 94, in parse_exp
    new_result = method(result, token, p)
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 474, in e_RawLeftBracket
    seq = self.parse_seq()
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 171, in parse_seq
    result.append(self.parse_exp(0))
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 94, in parse_exp
    new_result = method(result, token, p)
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 541, in e_RawColon
    expr2 = self.parse_exp(q + 1)
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 85, in parse_exp
    result = self.parse_p()
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 121, in parse_p
    return method(token)
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 254, in p_RawLeftParenthesis
    result = self.parse_exp(0)
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 98, in parse_exp
    new_result = self.parse_binary(result, token, p)
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 215, in parse_binary
    expr2 = self.parse_exp(q)
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 85, in parse_exp
    result = self.parse_p()
  File "/home/angus/Mathics/mathics/core/parser/parser.py", line 129, in parse_p
    raise InvalidSyntaxError()
@sn6uv sn6uv added the bug label Jan 16, 2017
@sn6uv
Copy link
Member Author

sn6uv commented Jan 16, 2017

Minimal example is _.. which should be Repeated[Blank[]] but is treated as incomplete.

@GarkGarcia GarkGarcia changed the title pattern parse bug Pattern parse bug Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant