-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4751 from Yokozuna59/add-pie-langium-parser
feat: add `pie` langium parser
- Loading branch information
Showing
37 changed files
with
554 additions
and
371 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { Pie } from '@mermaid-js/parser'; | ||
import { parse } from '@mermaid-js/parser'; | ||
import { log } from '../../logger.js'; | ||
import type { ParserDefinition } from '../../diagram-api/types.js'; | ||
import { populateCommonDb } from '../common/populateCommonDb.js'; | ||
import type { PieDB } from './pieTypes.js'; | ||
import { db } from './pieDb.js'; | ||
|
||
const populateDb = (ast: Pie, db: PieDB) => { | ||
populateCommonDb(ast, db); | ||
db.setShowData(ast.showData); | ||
ast.sections.map(db.addSection); | ||
}; | ||
|
||
export const parser: ParserDefinition = { | ||
parse: async (input: string): Promise<void> => { | ||
const ast: Pie = await parse('pie', input); | ||
log.debug(ast); | ||
populateDb(ast, db); | ||
}, | ||
}; |
Oops, something went wrong.