Skip to content

Commit

Permalink
Oops, remove more error_stack stuff.
Browse files Browse the repository at this point in the history
This should be the last of it.
  • Loading branch information
Andy Chu committed Sep 6, 2018
1 parent c6346a6 commit 41055e7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
15 changes: 0 additions & 15 deletions core/ui.py
Expand Up @@ -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]
Expand Down
2 changes: 0 additions & 2 deletions osh/bool_parse.py
Expand Up @@ -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:
Expand Down
7 changes: 3 additions & 4 deletions osh/cmd_parse.py
Expand Up @@ -272,7 +272,6 @@ def Reset(self):
Called by the interactive loop.
"""
self.error_stack = []
self.completion_stack = []

# Cursor state set by _Peek()
Expand All @@ -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.
Expand All @@ -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

Expand Down

0 comments on commit 41055e7

Please sign in to comment.