|
@@ -31,10 +31,9 @@ def __init__(self) -> None:
|
|
class QAPISourceInfo:
|
|
class QAPISourceInfo:
|
|
T = TypeVar('T', bound='QAPISourceInfo')
|
|
T = TypeVar('T', bound='QAPISourceInfo')
|
|
|
|
|
|
- def __init__(self, fname: str, line: int,
|
|
|
|
- parent: Optional['QAPISourceInfo']):
|
|
|
|
|
|
+ def __init__(self, fname: str, parent: Optional['QAPISourceInfo']):
|
|
self.fname = fname
|
|
self.fname = fname
|
|
- self.line = line
|
|
|
|
|
|
+ self.line = 1
|
|
self.parent = parent
|
|
self.parent = parent
|
|
self.pragma: QAPISchemaPragma = (
|
|
self.pragma: QAPISchemaPragma = (
|
|
parent.pragma if parent else QAPISchemaPragma()
|
|
parent.pragma if parent else QAPISchemaPragma()
|
|
@@ -52,10 +51,7 @@ def next_line(self: T) -> T:
|
|
return info
|
|
return info
|
|
|
|
|
|
def loc(self) -> str:
|
|
def loc(self) -> str:
|
|
- ret = self.fname
|
|
|
|
- if self.line is not None:
|
|
|
|
- ret += ':%d' % self.line
|
|
|
|
- return ret
|
|
|
|
|
|
+ return f"{self.fname}:{self.line}"
|
|
|
|
|
|
def in_defn(self) -> str:
|
|
def in_defn(self) -> str:
|
|
if self.defn_name:
|
|
if self.defn_name:
|