From: Jacob Lifshay Date: Tue, 1 Aug 2023 02:44:00 +0000 (-0700) Subject: add support for pseudocode being a [[!inline]] directive X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=43152e91f4530ddaef5cef2614b41e022c57fced;p=openpower-isa.git add support for pseudocode being a [[!inline]] directive --- diff --git a/src/openpower/decoder/pseudo/pagereader.py b/src/openpower/decoder/pseudo/pagereader.py index b2fca28e..a3db0ffb 100644 --- a/src/openpower/decoder/pseudo/pagereader.py +++ b/src/openpower/decoder/pseudo/pagereader.py @@ -52,7 +52,7 @@ import os import re opfields = ("desc", "form", "opcode", "regs", "pcode", "sregs", "page", - "extra_uninit_regs") + "extra_uninit_regs", "pcode_fname") Ops = namedtuple("Ops", opfields) @@ -222,6 +222,7 @@ class ISA: l = lines.pop(0).rstrip() # get first line prefix_lines = 0 while lines: + pcode_fname = fname if self.verbose: print(l) # look for HTML comment, if starting, skip line. @@ -310,8 +311,7 @@ class ISA: # fix parser line numbers by prepending the right number of # blank lines to the parser input - li = [""] * prefix_lines - li += [l[4:]] # first line detected with 4-space + li = [""] * (prefix_lines + 1) while True: l = lines.pop(0).rstrip() prefix_lines += 1 @@ -325,13 +325,50 @@ class ISA: extra_uninit_regs.add(i) li.append("") continue + if l.startswith("[[!inline "): + li.append(l) + continue if l.strip().startswith('