Permalink
Browse files
Oops, remove more error_stack stuff.
This should be the last of it.
- Loading branch information...
Showing
with
3 additions
and
21 deletions.
-
+0
−15
core/ui.py
-
+0
−2
osh/bool_parse.py
-
+3
−4
osh/cmd_parse.py
|
|
@@ -135,21 +135,6 @@ def PrettyPrintError(parse_error, arena, f=sys.stderr): |
|
|
print(parse_error.UserErrorString(), file=f)
|
|
|
|
|
|
|
|
|
def PrintErrorStack(error_stack, arena, f=sys.stderr):
|
|
|
"""
|
|
|
NOTE:
|
|
|
- Parse errors always occur within a single arena. Actually NO, you want to
|
|
|
show the 'source' stack trace like Python shows the import stack trace.
|
|
|
|
|
|
- Runtime errors may span arenas (e.g. the function stack).
|
|
|
"""
|
|
|
# - parse errors happen at runtime because of 'source'
|
|
|
# - should there be a distinction then?
|
|
|
for err in error_stack:
|
|
|
PrettyPrintError(err, arena, f=f)
|
|
|
print('---', file=f)
|
|
|
|
|
|
|
|
|
def PrintAst(nodes, opts):
|
|
|
if len(nodes) == 1:
|
|
|
node = nodes[0]
|
|
|
|
|
|
@@ -60,8 +60,6 @@ def __init__(self, w_parser): |
|
|
self.op_id = Id.Undefined_Tok
|
|
|
self.b_kind = Kind.Undefined
|
|
|
|
|
|
self.error_stack = []
|
|
|
|
|
|
def _NextOne(self, lex_mode=lex_mode_e.DBRACKET):
|
|
|
n = len(self.words)
|
|
|
if n == 2:
|
|
|
|
|
|
@@ -272,7 +272,6 @@ def Reset(self): |
|
|
|
|
|
Called by the interactive loop.
|
|
|
"""
|
|
|
self.error_stack = []
|
|
|
self.completion_stack = []
|
|
|
|
|
|
# Cursor state set by _Peek()
|
|
|
@@ -283,6 +282,9 @@ def Reset(self): |
|
|
|
|
|
self.pending_here_docs = []
|
|
|
|
|
|
def Error(self):
|
|
|
return 'TODO: for completion'
|
|
|
|
|
|
def ResetInputObjects(self):
|
|
|
"""Reset the internal state of our inputs.
|
|
|
|
|
|
@@ -292,9 +294,6 @@ def ResetInputObjects(self): |
|
|
self.lexer.ResetInputObjects()
|
|
|
self.line_reader.Reset()
|
|
|
|
|
|
def Error(self):
|
|
|
return self.error_stack
|
|
|
|
|
|
def GetCompletionState(self):
|
|
|
return self.completion_stack
|
|
|
|
|
|
|
0 comments on commit
41055e7