[libre-riscv-dev] [Bug 280] POWER spec parser needs to support fall-through cases

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Mon Apr 6 13:45:11 BST 2020


http://bugs.libre-riscv.org/show_bug.cgi?id=280

--- Comment #8 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
@@ -152,6 +154,8 @@ def annoying_case_hack_filter(code):
     for l in code.split("\n"):
         spc_count = count_spaces(l)
         nwhite = l[spc_count:]
+        if len(nwhite) == 0: # skip blank lines
+            continue
         if nwhite.startswith("case") or nwhite.startswith("default"):
             #print ("case/default", nwhite, spc_count, prev_spc_count)
             if (prev_spc_count is not None and
@@ -473,9 +477,11 @@ switch (n)

that was enough to get it to skip blank lines.  it "Does The Job".

yes it's not "clean / nice" however it's quick and it works.
moving on to the next task, kinda important.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-riscv-dev mailing list