On 11/4/25 14:21, Markus Armbruster wrote:
@@ -423,12 +428,55 @@ def get_doc_line(self) -> Optional[str]:
              if self.val != '##':
                  raise QAPIParseError(
                      self, "junk after '##' at end of documentation comment")
+            self._literal_mode = False
              return None
          if self.val == '#':
              return ''
          if self.val[1] != ' ':
              raise QAPIParseError(self, "missing space after #")
-        return self.val[2:].rstrip()
+
+        line = self.val[2:].rstrip()
+
+        if re.match(r'(\.\. +qmp-example)? *::$', line):
+            self._literal_mode = True
+            self._literal_mode_indent = 0
+        elif self._literal_mode and line:
+            indent = re.match(r'^ *', line).end()

Another failure from my incomplete testing last night:

https://gitlab.com/qemu-project/qemu/-/jobs/11982687207#L127

../scripts/qapi/parser.py:444: error: Item "None" of "Optional[Match[str]]" has no attribute "end" [union-attr]


r~

Reply via email to