waxeye-org / waxeye

Waxeye is a parser generator based on parsing expression grammars (PEGs). It supports C, Java, JavaScript, Python, Racket, and Ruby.
https://waxeye-org.github.io/waxeye/index.html
Other
235 stars 38 forks source link

Online demo fails on case insensitive quoted strings #111

Closed bkil closed 4 years ago

bkil commented 4 years ago

I typed this grammar into the online demo:

A <- "a"

I expected it to work equivalently to this one:

A <- [aA]

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
glebm commented 4 years ago

Perhaps RacketScript does not implement char-alphabetic?

glebm commented 4 years ago

Filed https://github.com/vishesh/racketscript/issues/170

glebm commented 4 years ago

Fixed! I've added the missing functions to RacketScript and updated the demo site