Commit 76320f11 authored by Igor Dejanovic's avatar Igor Dejanovic

Removed newline rule in csv example

parent 2e888150
...@@ -9,13 +9,12 @@ from arpeggio import * ...@@ -9,13 +9,12 @@ from arpeggio import *
from arpeggio.export import PMDOTExport, PTDOTExport from arpeggio.export import PMDOTExport, PTDOTExport
from arpeggio import RegExMatch as _ from arpeggio import RegExMatch as _
def newline(): return _(r'\n+')
def record(): return field, ZeroOrMore(",", field) def record(): return field, ZeroOrMore(",", field)
def field(): return [quoted_field, field_content] def field(): return [quoted_field, field_content]
def quoted_field(): return '"', field_content_quoted, '"' def quoted_field(): return '"', field_content_quoted, '"'
def field_content(): return _(r'([^,\n])+') def field_content(): return _(r'([^,\n])+')
def field_content_quoted(): return _(r'(("")|([^"]))+') def field_content_quoted(): return _(r'(("")|([^"]))+')
def csvfile(): return OneOrMore([record, newline]), EndOfFile def csvfile(): return OneOrMore([record, '\n']), EndOfFile
if __name__ == "__main__": if __name__ == "__main__":
......
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