Skip to content

Commit

Permalink
made parse error print to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Oct 13, 2008
1 parent 3badbe4 commit 78b5999
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion alexs_lang/parser.py
Expand Up @@ -168,4 +168,5 @@ def p_suite(self, t):
t[0] = t[3]

def p_error(self, t):
print "Syntax error at '%s'" % t.value
import sys
sys.stderr.write("Syntax error at '%s' on line %s.\n" % (t.value, t.lineno))
6 changes: 3 additions & 3 deletions tests/if.al
@@ -1,6 +1,6 @@
if True:
print(1)
a = 3
if False:
a = 4
print(a)
#if False:
# a = 4
#print(a)

0 comments on commit 78b5999

Please sign in to comment.