From 58b2b0993a9e0c93b25bc6203ebedb547f49a62c Mon Sep 17 00:00:00 2001 From: Ibrahim Wassouf Date: Sat, 8 Jul 2023 13:29:48 -0300 Subject: [PATCH] Give STR token higher precedence --- .../mermaid/src/diagrams/class/parser/classDiagram.jison | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/mermaid/src/diagrams/class/parser/classDiagram.jison b/packages/mermaid/src/diagrams/class/parser/classDiagram.jison index 93bae2d51..263e890e7 100644 --- a/packages/mermaid/src/diagrams/class/parser/classDiagram.jison +++ b/packages/mermaid/src/diagrams/class/parser/classDiagram.jison @@ -50,6 +50,10 @@ accDescr\s*"{"\s* { this.begin("acc_descr_multili "classDiagram" return 'CLASS_DIAGRAM'; "[*]" return 'EDGE_STATE'; +["] this.popState(); +[^"]* return "STR"; +<*>["] this.begin("string"); + "namespace" { this.begin('namespace'); return 'NAMESPACE'; } \s*(\r?\n)+ { this.popState(); return 'NEWLINE'; } \s+ /* skip whitespace */ @@ -110,10 +114,6 @@ Function arguments are optional: 'call ()' simply executes 'callb [^~]* return "GENERICTYPE"; "~" this.begin("generic"); -["] this.popState(); -[^"]* return "STR"; -<*>["] this.begin("string"); - [`] this.popState(); [^`]+ return "BQUOTE_STR"; <*>[`] this.begin("bqstring");