IndexError in parse_tree_builder.py, release 0.10.0
See original GitHub issueDescribe the bug
I’m trying to parse a snippet and I get this error:
contrib/python/lark-parser/lark/lark.py:438: in parse
return self.parser.parse(text, start=start)
contrib/python/lark-parser/lark/parser_frontends.py:215: in parse
return self._parse(text, start)
contrib/python/lark-parser/lark/parser_frontends.py:58: in _parse
return self.parser.parse(input, start, *args)
contrib/python/lark-parser/lark/parsers/earley.py:320: in parse
return transformer.transform(solutions[0])
contrib/python/lark-parser/lark/parsers/earley_forest.py:353: in transform
self.visit(root)
contrib/python/lark-parser/lark/parsers/earley_forest.py:295: in visit
vpno(current)
contrib/python/lark-parser/lark/parsers/earley_forest.py:417: in visit_packed_node_out
transformed = self.transform_packed_node(node, self.data[id(node)])
contrib/python/lark-parser/lark/parsers/earley_forest.py:559: in transform_packed_node
return self._call_rule_func(node, children)
contrib/python/lark-parser/lark/parsers/earley_forest.py:521: in _call_rule_func
return self.callbacks[node.rule](data)
contrib/python/lark-parser/lark/parse_tree_builder.py:124: in __call__
filtered = children[i].children
E IndexError: list index out of range
I can’t figure out what’s wrong, could you help me please?
To Reproduce
l = Lark(open('golang.lark').read(), start='go_file', regex=True)
l.parse("""
package x
func evalFrameHash(frame FrameData) norm.Hash {
h := [4]byte{0x5b, 0xd1, 0xe9, 0x95}
for i, b := range frame.FrameData() {
h[i%4] ^= b
}
return norm.Hash{Data: h}
""")
grammar is here https://gist.github.com/grihabor/2014488c65cde5a5ef71fd61c13a75d6
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
How to Fix IndexError in Python - Rollbar
The IndexError in Python occurs when an item from a list is attempted to be accessed that is outside the index range of...
Read more >Does "IndexError: list index out of range" when trying to ...
The IndexError is raised when you attempt to retrieve an index from a sequence, like a list or a tuple , and the...
Read more >IndexError: list index out of range [BUG] · Issue #298 - GitHub
Please complete the following information: pySCENIC version: [0.11.2]; Installation method: [pip]; Run environment: [Jupyter notebook]; OS: [ ...
Read more >Indexerror: list Index Out of Range in Python - STechies
List index out of range means index error in Python. It occurs when you try to access an index that is outside bounds...
Read more >Python IndexError: List Index Out of Range Error Explained
In this tutorial, you'll learn how all about the Python list index out of range error, including what it is, why it occurs,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Lark
0.11.0
has been released.Probably next week.