We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// Ohm-JS fails to complain about missing semantic actions - the ones that are commented out.
// If you delete "s2" from the formals of rexpr_general, Ohm-JS complains (correctly) about the arity mismatch.
var ohm = require ('ohm-js')
const grammar = ohm.grammar ( ` C2CL0 {
top = oneCharOrRexpr+
oneCharOrRexpr = | space -- space | &"(" rexpr -- rexpr | any -- other
rexpr = | pattern spaces -- pattern | "(" spaces rexpr* ")" spaces -- general | verbatim spaces -- verbatim | atom spaces -- bottom
pattern = ~any any any any verbatim = ~any any any any atom = ~any any any any } `);
const semantics = grammar.createSemantics ().addOperation ("junk", { top (x) {}, //oneCharOrRexpr_space (x) {}, //oneCharOrRexpr_rexpr (la, x) {}, //oneCharOrRexpr_other (x) {}, //rexpr_pattern (x, s) {}, rexpr_general (lp, s, rs, rp, s2) {}, //rexpr_verbatim (x, s) {}, //rexpr_bottom (x, s) {}, _terminal () {} });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
// Ohm-JS fails to complain about missing semantic actions - the ones that are commented out.
// If you delete "s2" from the formals of rexpr_general, Ohm-JS complains (correctly) about the arity mismatch.
var ohm = require ('ohm-js')
const grammar = ohm.grammar (
`
C2CL0 {
top = oneCharOrRexpr+
oneCharOrRexpr =
| space -- space
| &"(" rexpr -- rexpr
| any -- other
rexpr =
| pattern spaces -- pattern
| "(" spaces rexpr* ")" spaces -- general
| verbatim spaces -- verbatim
| atom spaces -- bottom
pattern = ~any any any any
verbatim = ~any any any any
atom = ~any any any any
}
`);
const semantics = grammar.createSemantics ().addOperation ("junk", {
top (x) {},
//oneCharOrRexpr_space (x) {},
//oneCharOrRexpr_rexpr (la, x) {},
//oneCharOrRexpr_other (x) {},
//rexpr_pattern (x, s) {},
rexpr_general (lp, s, rs, rp, s2) {},
//rexpr_verbatim (x, s) {},
//rexpr_bottom (x, s) {},
_terminal () {}
});
The text was updated successfully, but these errors were encountered: