summaryrefslogtreecommitdiff
path: root/pest_consume/examples/csv/csv.pest
blob: a67af8caf67e93afd813299d8e53f3d7285c1798 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
WHITESPACE = _{ " "+ }
newline = _{ "\r\n" | "\n" }
number = { "-"? ~ (ASCII_DIGIT | ".")+ }
string = { (!"'" ~ ASCII)* }
field = ${
      number
    | "'" ~ string ~ "'"
}
record = {
      field ~ ("," ~ field)*
    | ""
}
file = {
    SOI ~ record ~ (newline ~ record)* ~ newline? ~ EOI
}