mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-20 07:49:43 +02:00
feat: ANTLR parser achieves 97.4% pass rate (922/947 tests)
Major improvements: - Fixed individual node tracking in subgraphs with consistent ordering - Resolved nested subgraph node ordering issues - Fixed markdown string processing for both nodes and edges - Improved error handling and validation - Enhanced FlowDB integration Progress: 97.4% pass rate (922 passed, 22 failed, 3 skipped) Target: 99.7% pass rate to match Jison parser performance Remaining issues: - Text processing for special characters (8 failures) - Node data multi-line string processing (4 failures) - Interaction parsing (3 failures) - Style/class assignment (2 failures) - Vertex chaining class assignment (1 failure) - Markdown subgraph titles (1 failure)
This commit is contained in:
26
test-backslash.js
Normal file
26
test-backslash.js
Normal file
@@ -0,0 +1,26 @@
|
||||
// Test backslash character parsing
|
||||
const flow = require('./packages/mermaid/src/diagrams/flowchart/flowDb.ts');
|
||||
|
||||
// Set up ANTLR parser
|
||||
process.env.USE_ANTLR_PARSER = 'true';
|
||||
const antlrParser = require('./packages/mermaid/src/diagrams/flowchart/parser/antlr/antlr-parser.ts');
|
||||
|
||||
try {
|
||||
console.log('Testing backslash character: \\');
|
||||
|
||||
// Test the problematic input
|
||||
const input = 'graph TD; \\ --> A';
|
||||
console.log('Input:', input);
|
||||
|
||||
// Parse with ANTLR
|
||||
const result = antlrParser.parse(input);
|
||||
console.log('Parse result:', result);
|
||||
|
||||
// Check vertices
|
||||
const vertices = flow.getVertices();
|
||||
console.log('Vertices:', vertices);
|
||||
console.log('Backslash vertex:', vertices.get('\\'));
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
}
|
Reference in New Issue
Block a user