Skip to content
Snippets Groups Projects
Commit 5b55829c55ce authored by Robert Bradshaw's avatar Robert Bradshaw
Browse files

New message(...) distinct from warn(...)

parent a38345597938
Branches
No related tags found
Loading
...@@ -139,6 +139,17 @@ ...@@ -139,6 +139,17 @@
LEVEL=1 # warn about all errors level 1 or higher LEVEL=1 # warn about all errors level 1 or higher
def message(position, message, level=1):
if level < LEVEL:
return
warn = CompileWarning(position, message)
line = "note: %s\n" % warn
if listing_file:
listing_file.write(line)
if echo_file:
echo_file.write(line)
return warn
def warning(position, message, level=0): def warning(position, message, level=0):
if level < LEVEL: if level < LEVEL:
return return
......
from Errors import error, warning, warn_once, InternalError from Errors import error, warning, message, warn_once, InternalError
import ExprNodes import ExprNodes
import Nodes import Nodes
import Builtin import Builtin
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
# print "No assignments", entry.pos, entry # print "No assignments", entry.pos, entry
entry.type = py_object_type entry.type = py_object_type
if verbose: if verbose:
warning(entry.pos, "inferred '%s' to be of type '%s'" % (entry.name, entry.type), 1) message(entry.pos, "inferred '%s' to be of type '%s'" % (entry.name, entry.type))
resolve_dependancy(entry) resolve_dependancy(entry)
# Deal with simple circular dependancies... # Deal with simple circular dependancies...
for entry, deps in dependancies_by_entry.items(): for entry, deps in dependancies_by_entry.items():
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
for entry in dependancies_by_entry: for entry in dependancies_by_entry:
entry.type = py_object_type entry.type = py_object_type
if verbose: if verbose:
warning(entry.pos, "inferred '%s' to be of type '%s' (default)" % (entry.name, entry.type), 1) message(entry.pos, "inferred '%s' to be of type '%s' (default)" % (entry.name, entry.type))
def find_spanning_type(type1, type2): def find_spanning_type(type1, type2):
if type1 is type2: if type1 is type2:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment