qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, John Snow <jsnow@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Cleber Rosa <crosa@redhat.com>
Subject: [PATCH 3/6] qapi/error.py: move QAPIParseError to parser.py
Date: Tue, 22 Sep 2020 17:21:12 -0400	[thread overview]
Message-ID: <20200922212115.4084301-4-jsnow@redhat.com> (raw)
In-Reply-To: <20200922212115.4084301-1-jsnow@redhat.com>

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 --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."""
 
-- 
2.26.2



  parent reply	other threads:[~2020-09-22 22:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22 21:21 [PATCH 0/6] qapi: static typing conversion, pt4 John Snow
2020-09-22 21:21 ` [PATCH 1/6] qapi/error.py: refactor error classes John Snow
2020-09-22 21:21 ` [PATCH 2/6] qapi/parser.py: remove parser context from QAPIDoc John Snow
2020-09-22 21:21 ` John Snow [this message]
2020-09-22 21:21 ` [PATCH 4/6] qapi/parser.py: refactor QAPIParseError John Snow
2020-09-22 21:21 ` [PATCH 5/6] qapi/error.py: enable mypy checks John Snow
2020-09-22 21:21 ` [PATCH 6/6] qapi/error.py: enable pylint checks John Snow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200922212115.4084301-4-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).