fix: Use AST to replace notes & warnings.

This commit is contained in:
Sidharth Vinod
2022-10-28 14:13:24 +05:30
parent 6b3892baf1
commit d7bf92b39f
11 changed files with 68 additions and 127 deletions

View File

@@ -32,10 +32,8 @@ statement
In the extract of the grammar above, it is defined that a call to the setTitle method in the data object will be done when parsing and the title keyword is encountered.
> **Note**\
> **Note**
> Make sure that the `parseError` function for the parser is defined and calling `mermaid.parseError`. This way a common way of detecting parse errors is provided for the end-user.
>
> >
For more info look in the example diagram type:
@@ -50,8 +48,7 @@ exports.parseError = function (err, hash) {
when parsing the `yy` object is initialized as per below:
```javascript
var parser;
parser = exampleParser.parser;
const parser = exampleParser.parser;
parser.yy = db;
```
@@ -74,8 +71,8 @@ At this point when mermaid is trying to render the diagram, it will detect it as
### Setup
```javascript
var graph = require('./graphDb');
var flow = require('./parser/flow');
const graph = require('./graphDb');
const flow = require('./parser/flow');
flow.parser.yy = graph;
```
@@ -96,7 +93,7 @@ graph.getEdges();
The parser is also exposed in the mermaid api by calling:
```javascript
var parser = mermaid.getParser();
const parser = mermaid.getParser();
```
Note that the parse needs a graph object to store the data as per: