文件名称:qua:用于JavaScript TypeScript的Monadic解析器组合器
文件大小:447KB
文件格式:ZIP
更新时间:2024-02-24 22:31:51
javascript typescript parsing parser-combinators ParsingJavaScript
qua 受启发的JavScript的Monadic解析器组合器。 import * as lq from "@loquat/simple" ; const nat = lq . digit . manyChars1 ( ) . map ( str => parseInt ( str , 10 ) ) ; const op = lq . choice ( [ lq . char ( "+" ) . return ( ( a , b ) => a + b ) , lq . char ( "-" ) . return ( ( a , b ) => a - b ) , ] ) ; cons