Is there a simple way to make it such that rules like the following assume there may be whitespace between the tokens, without the need to explicitly spell it out in every single rule? For example, using lex and yacc, you just make WSP a no-op and the lexer skips over it, meaning its not visible in your parse tree.
# simply
rule(:math_expr) { t_int.as(:left) >> operator.as(:op) >> t_int.as(:right) }
# rather than the verbose
rule(:math_expr) { t_int.as(:left) >> wsp? >> operator.as(:op) >> wsp? >> t_int.as(:right) }
Is there a simple way to make it such that rules like the following assume there may be whitespace between the tokens, without the need to explicitly spell it out in every single rule? For example, using lex and yacc, you just make WSP a no-op and the lexer skips over it, meaning its not visible in your parse tree.