Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tadeusz Sośnierz
committed
Apr 19, 2015
1 parent
971f0c1
commit 40afe2a
Showing
3 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env perl6 | ||
use Grammar::BNF; | ||
use Test; | ||
|
||
my ($t, $p); | ||
|
||
$t = q[ | ||
<foo> ::= "bar" | ||
]; | ||
ok Grammar::BNF.generate($t, name => 'test1').new.parse('bar'); | ||
|
||
$t = q[ | ||
<foo> ::= <bar> | ||
<bar> ::= "baz" | ||
]; | ||
ok Grammar::BNF.generate($t, name => 'test2').new.parse('baz'); | ||
|
||
|
||
$t = q[ | ||
<foo> ::= <bar> | <baz> | ||
<bar> ::= "bar" | <baz> | ||
<baz> ::= "buzz" | ||
]; | ||
ok Grammar::BNF.generate($t).new.parse('buzz'); | ||
|
||
$t = q[ | ||
<foo> ::= <bar> <baz> | ||
<bar> ::= 'foo' | ||
<baz> ::= 'bar' | ||
]; | ||
ok Grammar::BNF.generate($t).new.parse('foobar'); | ||
|
||
# TODO: Tests for other things in parse.t | ||
|
||
done; |
File renamed without changes.