Open apalala opened 5 years ago
+1.
And I found another issue.
When #include
are chained, the first #include
must be written from the parent directory, but the next #include
must be written with a relative path.
src tree
$ tree python-paml/src
python-paml/src
└── paml
├── cli.py
└── lib
├── __init__.py
├── grammar
│ ├── json.ebnf
│ ├── paml.ebnf
│ └── yaml.ebnf
├── main.py
└── parser.py
paml.ebnf
@@grammar :: PAML
@@whitespace :: //
@@parseinfo :: True
- yaml.ebnf
@@grammar :: YAML @@whitespace :: // @@parseinfo :: True
- json.ebnf
@@grammar :: JSON @@whitespace :: // @@parseinfo :: True
start = jsonvalue $ ;
jsonobject = '{' ws ','%{ ws jsonstring ws ':' ws jsonvalue ws }* '}' ;
jsonarray = '[' ','%{ jsonvalue }* ']' ;
jsonvalue = ws jsonvalue_ ws;
jsonvalue_ = | jsonfalse | jsontrue | jsonnull | jsonobject | jsonarray | jsonnumber | jsonstring ;
jsonnumber = jsonfloat | jsonint; jsonint = /[0-9]+/ ; jsonfloat = /[0-9]+.[0-9]+/ ; jsonstring = /"[^"]"/ ; jsontrue = /true/ ; jsonfalse = /false/ ; jsonnull = /null/ ; ws = /[ \t\n\r]/ ;
With
base.ebnf
andfull.ebnf
in the same directory with:Will search for the include in the current or parent directory, and fail.