Skip to content

Commit

Permalink
Fix Doc string for match-expression with string (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
phannebohm authored Jul 15, 2024
1 parent 6317cf5 commit 1c2684b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion syntaxes/metamodelica.tmGrammar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ patterns:
end: \)\s*;

# Documentation Strings
- match: (?<!else\s*)(?<![=+]\s*)((?<!\\)"([^"]|\\")*(?<!\\)")\s*;
- match: (?<!\bthen\s*)(?<!\belse\s*)(?<![=+]\s*)((?<!\\)"([^"]|\\")*(?<!\\)")\s*;
captures:
1:
name: comment.line
Expand Down
11 changes: 11 additions & 0 deletions test/metamodelica/Docstring.test.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SYNTAX TEST "source.metamodelica" "Doc string"

function f
algorithm
str := match some_var
case _ then "";
// ^^ source.metamodelica string.quoted.double
else "";
// ^^ source.metamodelica string.quoted.double
end match;
end f;

0 comments on commit 1c2684b

Please sign in to comment.