clo/parserRule.txt

33 lines
No EOL
642 B
Text

import foo from 'bar';
行到水窮處坐看雲起時@blah()@下一句是什麼?
我沒背唐詩。
#h1()
@h1()@
------
要變成
import 'clo';
import foo from 'bar';
clo = clo();
clo.mainText = `行到水窮處坐看雲起時`+blah()+`下一句是什麼?
我沒背唐詩。`
clo.genPdf(path);
----
BODY = IMPORTS SENTENCES | SENTENCES
IMPORTS = import SP IMPORTINNER ; NL IMPORTS | import IMPORTINNER ;
IMPORTINNER = NOT[;] IMPORTINNER | NOT[;]
SENTENCES = SENTENCE SENTENCES
SENTENCE = TEXT | STMT | None
TEXT = TEXT_SEG TEXT | TEXT_SEG
TEXT_SEG = ([^@\] | \ @ | \ \ )
STMT = @ STMTINNER @
STMTINNER = [^@] STMTINNER | [^@]