modify somethinig
This commit is contained in:
parent
df1419e45c
commit
d4dfd2e99f
2 changed files with 6 additions and 8 deletions
|
@ -100,12 +100,12 @@ import you as john;
|
||||||
|
|
||||||
臺中市\\\@
|
臺中市\\\@
|
||||||
|
|
||||||
政府
|
公園
|
||||||
@2+2==4;
|
@1+2==3;
|
||||||
|
|
||||||
console.log("122");@
|
console.log("122");@
|
||||||
|
|
||||||
人民
|
山頂
|
||||||
`;
|
`;
|
||||||
const PROG = p.rule();
|
const PROG = p.rule();
|
||||||
const SEGMENT = 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 : SEGMENT*
|
||||||
*/
|
*/
|
||||||
CONTENT.setPattern(p.apply(p.rep(SEGMENT), applyContent));
|
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))));
|
let tree = p.expectSingleResult(p.expectEOF(PROG.parse(lexer.parse(inputTxt))));
|
||||||
console.log("RESULT=" + tkTreeToSExp(tree));
|
console.log("RESULT=" + tkTreeToSExp(tree));
|
||||||
|
|
|
@ -88,12 +88,12 @@ import you as john;
|
||||||
|
|
||||||
臺中市\\\@
|
臺中市\\\@
|
||||||
|
|
||||||
政府
|
公園
|
||||||
@2+2==4;
|
@1+2==3;
|
||||||
|
|
||||||
console.log("122");@
|
console.log("122");@
|
||||||
|
|
||||||
人民
|
山頂
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
||||||
|
@ -258,7 +258,6 @@ CONTENT.setPattern(
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
console.log(repr(lexer.parse(inputTxt)));
|
|
||||||
let tree = p.expectSingleResult(p.expectEOF(PROG.parse(lexer.parse(inputTxt))));
|
let tree = p.expectSingleResult(p.expectEOF(PROG.parse(lexer.parse(inputTxt))));
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue