mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 16:59:48 +02:00
Fix info
This commit is contained in:
@@ -28,14 +28,18 @@ class InfoParser extends EmbeddedActionsParser {
|
|||||||
infoDb.clear();
|
infoDb.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public infoDiagram = this.RULE('infoDiagram', () => {
|
public diagram = this.RULE('diagram', () => {
|
||||||
this.MANY(() => {
|
this.MANY(() => {
|
||||||
this.CONSUME(NewLine);
|
this.CONSUME(NewLine);
|
||||||
});
|
});
|
||||||
this.SUBRULE(this.hdr);
|
this.SUBRULE(this.hdr);
|
||||||
this.AT_LEAST_ONE(() => {
|
this.MANY2(() => {
|
||||||
this.SUBRULE2(this.row);
|
this.SUBRULE2(this.row);
|
||||||
});
|
});
|
||||||
|
infoDb.setInfo(true);
|
||||||
|
this.MANY3(() => {
|
||||||
|
this.CONSUME2(NewLine);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
public hdr = this.RULE('hdr', () => {
|
public hdr = this.RULE('hdr', () => {
|
||||||
@@ -61,7 +65,7 @@ const parser = new InfoParser();
|
|||||||
const parse = (text: string): void => {
|
const parse = (text: string): void => {
|
||||||
const lexResult = InfoLexer.tokenize(text);
|
const lexResult = InfoLexer.tokenize(text);
|
||||||
parser.input = lexResult.tokens;
|
parser.input = lexResult.tokens;
|
||||||
parser.infoDiagram();
|
parser.diagram();
|
||||||
|
|
||||||
if (parser.errors.length > 0 || lexResult.errors.length > 0) {
|
if (parser.errors.length > 0 || lexResult.errors.length > 0) {
|
||||||
log.error(
|
log.error(
|
||||||
|
Reference in New Issue
Block a user