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

Tutorial Error: lark.exceptions.VisitError: Error trying to process rule "float_type" #24

Closed
BwRy opened this issue Jul 7, 2023 · 2 comments · Fixed by #28
Closed

Comments

@BwRy
Copy link

BwRy commented Jul 7, 2023

I installed pymlir via pip3 install ./ in the directory that has setup.py.
When attempting to follow the tutorial, I get the following error:

Python 3.8.10 (default, May 26 2023, 14:05:08) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mlir
>>> ast1 = mlir.parse_path('toy.mlir')
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 47, in _call_userfunc
    return f(children)
  File "/usr/local/lib/python3.8/dist-packages/mlir/astnodes.py", line 17, in from_lark
    assert not any(isinstance(el, (Token, Tree)) for el in args)
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/mlir/parser.py", line 159, in parse_path
    return parse_file(fp, dialects)
  File "/usr/local/lib/python3.8/dist-packages/mlir/parser.py", line 146, in parse_file
    return parse_string(file.read(), dialects)
  File "/usr/local/lib/python3.8/dist-packages/mlir/parser.py", line 133, in parse_string
    return parser.parse(code)
  File "/usr/local/lib/python3.8/dist-packages/mlir/parser.py", line 96, in parse
    root_node = self.transformer.transform(tree)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 84, in transform
    return self._transform_tree(tree)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 80, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 71, in _transform_children
    yield self._transform_tree(c)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 81, in _transform_tree
    return self._call_userfunc(tree, children)
  File "/usr/local/lib/python3.8/dist-packages/lark/visitors.py", line 51, in _call_userfunc
    raise VisitError(tree, e)
lark.exceptions.VisitError: Error trying to process rule "float_type":

Platform:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.6 LTS
Release:	20.04
Codename:	focal

$ python3
Python 3.8.10 (default, May 26 2023, 14:05:08) 
[GCC 9.4.0] on linux
>>> import lark
>>> lark.__version__
'0.7.8'
>>> import parse
>>> parse.__version__
'1.14.0'
@JibinArvin
Copy link

Same issue as you..

@tbennun
Copy link
Contributor

tbennun commented Nov 9, 2023

@BwRy @JibinArvin if you have a chance, please try this after #28 is now merged (thanks, @amanda849!)

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 a pull request may close this issue.

3 participants