diff mbox series

[3/6] qapi/error.py: move QAPIParseError to parser.py

Message ID 20200922212115.4084301-4-jsnow@redhat.com
State New
Headers show
Series qapi: static typing conversion, pt4 | expand

Commit Message

John Snow Sept. 22, 2020, 9:21 p.m. UTC
Signed-off-by: John Snow <jsnow@redhat.com>
---
 scripts/qapi/error.py  | 12 ------------
 scripts/qapi/parser.py | 14 +++++++++++++-
 2 files changed, 13 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/scripts/qapi/error.py b/scripts/qapi/error.py
index 47f266f33d..ab6a0f6271 100644
--- a/scripts/qapi/error.py
+++ b/scripts/qapi/error.py
@@ -38,17 +38,5 @@  def __str__(self) -> str:
         return f"{loc}: {self.msg}"
 
 
-class QAPIParseError(QAPISourceError):
-    """Error class for all QAPI schema parsing errors."""
-    def __init__(self, parser, msg):
-        col = 1
-        for ch in parser.src[parser.line_pos:parser.pos]:
-            if ch == '\t':
-                col = (col + 7) % 8 + 1
-            else:
-                col += 1
-        super().__init__(parser.info, msg, col)
-
-
 class QAPISemError(QAPISourceError):
     """Error class for semantic QAPI errors."""
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index cb2595ce60..7e7eda9ed9 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -18,10 +18,22 @@ 
 import re
 from collections import OrderedDict
 
-from .error import QAPIError, QAPIParseError, QAPISemError
+from .error import QAPIError, QAPISourceError, QAPISemError
 from .source import QAPISourceInfo
 
 
+class QAPIParseError(QAPISourceError):
+    """Error class for all QAPI schema parsing errors."""
+    def __init__(self, parser, msg):
+        col = 1
+        for ch in parser.src[parser.line_pos:parser.pos]:
+            if ch == '\t':
+                col = (col + 7) % 8 + 1
+            else:
+                col += 1
+        super().__init__(parser.info, msg, col)
+
+
 class QAPIDocError(QAPIError):
     """Documentation parsing error."""