1 unstable release

0.1.0 Jan 18, 2022

#9 in #dft

MIT license

16KB
328 lines

dft.p

dft instructions file parser

description

this lib/bin project is the official tool to parse, lint and fix .dft files

why

while working in the dft project I realized 2 things:

  • the dft tool itself shouldn't be responsible of parsing the instructions file, but rather the execution itself

  • haven't made a parser yet, so... here's one

grammar (BNF)

:= | ;

:= ; ;

:= ;

:= SET | ADD | ALIAS | MERGE | IGNORE | RENAME | FILTER | COERCE | DISTINCT | VALIDATE ;

:= | , ;

:= String ;

:= | ;

:= ;

:= OR | TO | TYPED | RESCUE | DEFAULT | MATCHING ;

:= | | | | ;

:= f64 | String | bool | isize ;

:= FLOAT | STRING | INTEGER | BOOLEAN ;

:= URI | UUID | DATE | TIME | EMAIL | DATETIME ;

:= HALT | NOTIFY | DISCARD ;

:= EQUALS | LESSER | DIFFERS | GREATER | EQLESSER | EQGREATER ;

TODO

[] Improve combinators that return lists [] Improve error verbosity

Dependencies

~1MB
~19K SLoC