Change the railroad diagram input from EBNF grammar notation to an
explicit IR that directly describes layout primitives: sequence(),
choice(), optional(), oneOrMore(), zeroOrMore(), terminal(),
nonterminal(), and special().
This separates the concern of grammar notation parsing from diagram
layout, enabling grammar-specific front-ends (EBNF, ABNF, PEG) to
be layered on top as independent modules.
The detector only accepts 'railroad-diagram', making the 'railroad'
alias in the grammar unreachable through normal diagram detection.
Remove it from the grammar and update the corresponding parser test
to use 'railroad-diagram' for consistency.
Replace monolithic NODE_CONTENT terminal with structured terminals
(QUOTED_NAME, BARE_NAME, CLASS_ANNOTATION, ICON_ANNOTATION,
DESC_ANNOTATION) so the grammar handles parsing instead of imperative
regex in parser.ts.
- Rewrite treeView.langium with 5 structured terminals
- Update valueConverter.ts with converters for each terminal
- Simplify parser.ts by removing parseNodeContent() entirely
- Rewrite parser.spec.ts as integration tests
- Update treeView.test.ts for new AST fields
Addresses reviewer feedback from @lee-treehouse on PR #7527.
Fixes a semantic merge conflict in
`packages/parser/tests/architecture.test.ts` due to the Langium v4
changing the `Architecture` value to `Architecture.$type`.
Conflicts:
package.json
pnpm-lock.yaml
Updates the `@mermaid-js/parser` to Langium v4.
There were a couple of breaking changes we had to fix to do this
upgrade:
- Rename all the grammers from Abc to AbcGrammar, as rules
within grammars cannot have the same name as the grammar.
- Update the tests, since the generated type names from `ast.ts` have
been moved from `<typeName>` to `<typeName>.$type`.
- Turn the EOL fragment into a rule, as in Langium v4, it's no longer
allowed and throws an error.
As this is a **BREAKING CHANGE** for users, I've made a new major
release in the changeset (and it means we can finally get a v1.0.0 of
`@mermaid-js/parser`).
Support for both compact and relaxed notation implemented. It is interchangeable.
Time Frame reference token uses Sequence diagram convention as suggested in PR.
Documentation updated as well.
* develop: (266 commits)
chore: update E2E timings
docs: Update changeset
fix: Add useful error message to test
chore: Add treemap example
chore: Add treemap example
chore: Add peerDependency to @mermaid-js/examples
Version Packages
docs: Update changeset
update in changeset
updated validaor and tests to use treemap
Updated parser to use treemap
chore: Fail build in CI on type errors
fix text going outside node
Version Packages
Updated phpbb url to support 403 in lychee
Updated lychee for working url phpbb.com
resolve PR comment
resolve PR comments
chore: update E2E timings
add changeset
...
This initial version contain working parser for the Event Modeling text DSL.
It has also trivial renderer that lays out entities in three fixed
swimlanes. There are no edges yet. It is to prove the whole lifecycle and
get familiar with all the places when implementing new diagram type.