mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 15:02:13 +00:00
board_inspector: fix an opcode peek issue
When parsing a sequence of clauses, it is not necessary to peek an opcode from the current stream unless that sequence starts with one. Peeking an opcode is even an error when the actual clause is empty (e.g. as a TermList). This patch makes the SequenceFactory only peeking at the next opcode when the grammar expects one. Tracked-On: #6298 Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
parent
3bcb3146ad
commit
35edd7804a
@ -297,7 +297,6 @@ class SequenceFactory(Factory):
|
||||
tree.complete_parsing()
|
||||
return tree
|
||||
|
||||
opcode, opcode_width = stream.peek_opcode()
|
||||
package_end = 0
|
||||
|
||||
# Under any case this function shall maintain the balance of stream scopes. The following flags indicate the
|
||||
@ -310,8 +309,8 @@ class SequenceFactory(Factory):
|
||||
pos = stream.current
|
||||
try:
|
||||
if isinstance(elem, int): # The leading opcode
|
||||
opcode, _ = stream.get_opcode()
|
||||
assert elem == opcode
|
||||
stream.seek(opcode_width)
|
||||
elif elem.endswith("*"):
|
||||
elem = elem[:-1]
|
||||
factory = globals()[elem]
|
||||
|
Loading…
Reference in New Issue
Block a user