bug: multiple generated solutions
parent
a2d373d426
commit
e5c5b3e101
27
src/lang.bnf
27
src/lang.bnf
|
|
@ -1,29 +1,16 @@
|
|||
|
||||
|
||||
<program> ::= <_n> <program$1> <_n>
|
||||
|
||||
<program$1> ::= <unit>
|
||||
| <unit> <_> <__n> <program$1>
|
||||
|
||||
|
||||
|
||||
<unit> ::= <use_clause>
|
||||
| <handler>
|
||||
|
||||
|
||||
|
||||
|
||||
<use_clause> ::= "use" <__> <namespace>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<body> ::= "{ }"
|
||||
<parameters> ::= "()"
|
||||
|
||||
|
||||
|
||||
<namespace> ::= <identifier> | <identifier> "::" <namespace>
|
||||
<static_ref> ::= "$" <identifier>
|
||||
|
||||
|
|
@ -43,11 +30,11 @@
|
|||
<INTEGER> ::= <DIGIT> | <DIGIT> <INTEGER>
|
||||
|
||||
<__n> ::= <EOL> <_n>
|
||||
<_n> ::= <NOTHING>
|
||||
| <SPACE> | <TAB> | <EOL>
|
||||
| <SPACE> <_n>
|
||||
| <TAB> <_n>
|
||||
| <EOL> <_n>
|
||||
<_n> ::= <NOTHING> | <_n$1>
|
||||
<_n$1> ::= <SPACE> | <TAB> | <EOL>
|
||||
| <SPACE> <_n$1>
|
||||
| <TAB> <_n$1>
|
||||
| <EOL> <_n$1>
|
||||
<_> ::= <NOTHING> | <__>
|
||||
<__> ::= <SPACE> | <TAB>
|
||||
| <SPACE> <__>
|
||||
|
|
@ -55,7 +42,3 @@
|
|||
|
||||
<NOTHING> ::= ""
|
||||
<SPACE> ::= " "
|
||||
<EOL> ::= "
|
||||
" | "
|
||||
"
|
||||
<TAB> ::= " "
|
||||
|
|
@ -14,7 +14,8 @@ use crate::transformers::base::Program;
|
|||
|
||||
fn main() {
|
||||
|
||||
let input = include_str!("lang.bnf");
|
||||
let input = include_str!("lang.bnf").to_owned()
|
||||
+ "\n<EOL> ::= \"\n\" | \"\r\n\"\n<TAB> ::= \"\t\"";
|
||||
let grammar: Grammar = input.parse().unwrap();
|
||||
|
||||
let vm_file = include_str!("person.vm");
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
use vlib::Console
|
||||
use vlib::thing::foo::bar::Console
|
||||
|
||||
use vlib::Map
|
||||
Loading…
Reference in New Issue