|
|
|
@ -55,6 +55,14 @@ module.exports = function ( chai, utils ) {
|
|
|
|
|
|
|
|
|
|
const ast = parser.parse( grammar );
|
|
|
|
|
|
|
|
|
|
if ( ! options.allowedStartRules ) {
|
|
|
|
|
|
|
|
|
|
options.allowedStartRules = ast.rules.length > 0
|
|
|
|
|
? [ ast.rules[ 0 ].name ]
|
|
|
|
|
: [];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
utils.flag( this, "object" )( ast, options );
|
|
|
|
|
|
|
|
|
|
this.assert(
|
|
|
|
@ -73,6 +81,14 @@ module.exports = function ( chai, utils ) {
|
|
|
|
|
|
|
|
|
|
const ast = parser.parse( grammar );
|
|
|
|
|
|
|
|
|
|
if ( ! options.allowedStartRules ) {
|
|
|
|
|
|
|
|
|
|
options.allowedStartRules = ast.rules.length > 0
|
|
|
|
|
? [ ast.rules[ 0 ].name ]
|
|
|
|
|
: [];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let passed, result;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|