[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5931 - grc/trunk/src
From: |
jblum |
Subject: |
[Commit-gnuradio] r5931 - grc/trunk/src |
Date: |
Tue, 10 Jul 2007 21:35:14 -0600 (MDT) |
Author: jblum
Date: 2007-07-10 21:35:13 -0600 (Tue, 10 Jul 2007)
New Revision: 5931
Modified:
grc/trunk/src/MathExprParser.py
Log:
fixed minor bug in math parser: checking for none type
Modified: grc/trunk/src/MathExprParser.py
===================================================================
--- grc/trunk/src/MathExprParser.py 2007-07-10 20:13:40 UTC (rev 5930)
+++ grc/trunk/src/MathExprParser.py 2007-07-11 03:35:13 UTC (rev 5931)
@@ -466,12 +466,12 @@
if not _is_comma(element):
if not _is_list(element) and not _is_number(element)
and element not in _CONSTANTS.values():
raise NameError, 'Unknown symbol
"%s".'%(element)
- if last_element and not _is_comma(last_element):
#elements not separated by commas
+ if last_element != None and not
_is_comma(last_element): #elements not separated by commas
raise SyntaxError, 'Expected comma, but found
"%s".'%(element)
vector.append(element) #good syntax, record the element
elif _is_comma(element) and _is_comma(last_element): #2
commas in a row
raise SyntaxError, 'Commas must be separated by
non-commas.'
- elif _is_comma(element) and not last_element: #a comma was
the first element
+ elif _is_comma(element) and last_element == None: #a
comma was the first element
raise SyntaxError, 'A non-comma must precede a comma.'
last_element = element
if len(vector) == 1 and not _is_comma(last_element): return vector[0]
#return single number
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5931 - grc/trunk/src,
jblum <=