However, it failed to compile with the following error message:
RacketContractError: memf: contract violation
expected: (any/c . -> any/c)
given: #<void>
at https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:1988:14
at Object.makeArgumentError (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:2048:12)
at Object.argerror (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:4399:48)
at Object.memf (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:14319:27)
at visit_case_literal (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:25591:12)
at visit_exp1743 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:25433:32)
at loop1626 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:11615:11)
at cl965 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:11620:23)
at Object.<anonymous> (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:11692:27)
at lift_only_sub_exp1735 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:25368:10)
at visit_sequence1741 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:25390:14)
at loop1626 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:11615:11)
at cl965 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:11620:23)
at Object.<anonymous> (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:11692:27)
at lift_only_sub_exp1735 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:25368:10)
at visit_alternation1740 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:25383:14)
at expand_def1751 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:25496:14)
at loop1626 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:11615:11)
at cl965 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:11620:23)
at Object.<anonymous> (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:11692:27)
at Object.expand_grammar (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:25498:15)
at Object.transform_grammar (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:25941:32)
at transform_and_set_start32 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:28494:10)
at cl3 (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:28506:12)
at https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:28520:25
at Object.generate_parser [as generateParser] (https://waxeye-org.github.io/waxeye/genfiles/racketscript-waxeye-compiler.js:28552:22)
at safeWaxeyeCompiler (https://waxeye-org.github.io/waxeye/demo.js:39:36)
at compile (https://waxeye-org.github.io/waxeye/demo.js:47:43)
at https://waxeye-org.github.io/waxeye/demo.js:155:11
I typed this grammar into the online demo:
I expected it to work equivalently to this one:
However, it failed to compile with the following error message: