mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 12:13:22 +00:00
fix regression from refactoring error message construction
This commit is contained in:
parent
b5797704ff
commit
f1aae4a7b5
@ -215,6 +215,12 @@ def makeBuiltinUsing(tname):
|
||||
builtinUsing = [ makeBuiltinUsing(t) for t in builtin.Types ]
|
||||
builtinIncludes = [ CxxInclude(_builtinloc, f) for f in builtin.Includes ]
|
||||
|
||||
def errormsg(loc, fmt, *args):
|
||||
while not isinstance(loc, Loc):
|
||||
if loc is None: loc = Loc.NONE
|
||||
else: loc = loc.loc
|
||||
return '%s: error: %s'% (str(loc), fmt % args)
|
||||
|
||||
##--------------------
|
||||
class SymbolTable:
|
||||
def __init__(self, errors):
|
||||
@ -325,10 +331,7 @@ class TcheckVisitor(Visitor):
|
||||
self.errors = errors
|
||||
|
||||
def error(self, loc, fmt, *args):
|
||||
while not isinstance(loc, Loc):
|
||||
if loc is None: loc = Loc.NONE
|
||||
else: loc = loc.loc
|
||||
self.errors.append('%s: error: %s'% (str(loc), fmt % args))
|
||||
self.errors.append(errormsg(loc, fmt, *args))
|
||||
|
||||
def declare(self, loc, type, shortname=None, fullname=None, progname=None):
|
||||
d = Decl(loc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user