X-Git-Url: https://git.kianting.info/?a=blobdiff_plain;f=src%2Findex.js;h=15e18628b9bd679b10e00ed1215069f029b1dfe2;hb=d4dfd2e99f564ca880d40172687986ea3ce757f0;hp=6b49d56f4b9c14b43a2d4306bf351c41d83b807f;hpb=df1419e45c41c5681b9cdad914c360ff16052fc5;p=clo diff --git a/src/index.js b/src/index.js index 6b49d56..15e1862 100644 --- a/src/index.js +++ b/src/index.js @@ -100,12 +100,12 @@ import you as john; 臺中市\\\@ -政府 -@2+2==4; +公園 +@1+2==3; console.log("122");@ -人民 +山頂 `; const PROG = p.rule(); const SEGMENT = p.rule(); @@ -202,6 +202,5 @@ SEGMENT.setPattern(p.alt(p.apply(p.rep_sc(NOT_AT_TEXT), applyText), p.apply(p.se * CONTENT : SEGMENT* */ CONTENT.setPattern(p.apply(p.rep(SEGMENT), applyContent)); -console.log(repr(lexer.parse(inputTxt))); let tree = p.expectSingleResult(p.expectEOF(PROG.parse(lexer.parse(inputTxt)))); console.log("RESULT=" + tkTreeToSExp(tree));