From: Eric S. Raymond Date: Wed, 21 Jan 2004 03:31:22 +0000 (+0000) Subject: Handle continuation digits. X-Git-Tag: 1.0~178 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=69fa673e050e3237b99920bf7354821b08c2af24;p=mad.git Handle continuation digits. --- diff --git a/mad b/mad index 382ed01..33f2bcb 100755 --- a/mad +++ b/mad @@ -41,7 +41,6 @@ t_DIVIDE = r'/' t_EQUALS = r'=' t_LPAREN = r'\(' t_RPAREN = r'\)' -#t_INTNUM = r'\d+' t_STRING = r'\$[^$]*\$' reserved_map = { } @@ -537,7 +536,9 @@ if __name__ == '__main__': fp = open(file) source = fp.read() fp.close() - # Grotty hack to add end-of-statement delimiters + # Grotty hack to remove continuation digits + source = re.sub("\n [0-9] ", "\n ", source) + # Equally grotty hack to add end-of-statement delimiters source = re.sub('\n([A-Z]|\t)', ' ;\n\\1', source).rstrip() + ' ;\n' # Parse yacc.parse(source, debug=mad_debug)