Commit c2bfe9d0 authored by Nils Goroll's avatar Nils Goroll

Tolerate whitespace in declarations

This fixes a regression against 4.1

Reported by Dridi
parent cbc900ae
...@@ -244,12 +244,12 @@ def arg(txt): ...@@ -244,12 +244,12 @@ def arg(txt):
i = s.find(',') i = s.find(',')
if i < 0: if i < 0:
i = len(s) i = len(s)
a.nm = s[:i] a.nm = s[:i].rstrip()
s = s[i:] s = s[i:]
return a, s return a, s
a.nm = s[:i] a.nm = s[:i].rstrip()
s = s[i+1:] s = s[i+1:].lstrip()
if s[0] == '"' or s[0] == "'": if s[0] == '"' or s[0] == "'":
m = re.match("(['\"]).*?(\\1)", s) m = re.match("(['\"]).*?(\\1)", s)
if not m: if not m:
...@@ -260,7 +260,7 @@ def arg(txt): ...@@ -260,7 +260,7 @@ def arg(txt):
i = s.find(',') i = s.find(',')
if i < 0: if i < 0:
i = len(s) i = len(s)
a.defval = s[:i] a.defval = s[:i].rstrip()
s = s[i:] s = s[i:]
return a,s return a,s
...@@ -294,6 +294,7 @@ class prototype(object): ...@@ -294,6 +294,7 @@ class prototype(object):
while len(s) > 0: while len(s) > 0:
a,s = arg(s) a,s = arg(s)
self.args.append(a) self.args.append(a)
s = s.lstrip()
if len(s) == 0: if len(s) == 0:
break; break;
assert s[0] == ',' assert s[0] == ','
......
...@@ -103,8 +103,8 @@ Encrypt the HTTP header with quad-ROT13 encryption, ...@@ -103,8 +103,8 @@ Encrypt the HTTP header with quad-ROT13 encryption,
(this is approx 33% better than triple-DES). (this is approx 33% better than triple-DES).
$Function STRING argtest( $Function STRING argtest(
STRING one, REAL two=2, STRING three="3", STRING one, REAL two =2, STRING three= "3",
STRING comma=",", INT four=4) STRING comma="," , INT four = 4 )
$Function INT vre_limit() $Function INT vre_limit()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment