diff --git a/syntaxes/metamodelica.tmGrammar.yaml b/syntaxes/metamodelica.tmGrammar.yaml index 8aa5dbd..5e40875 100644 --- a/syntaxes/metamodelica.tmGrammar.yaml +++ b/syntaxes/metamodelica.tmGrammar.yaml @@ -106,7 +106,7 @@ patterns: - include: "source.metamodelica" # Option literals - - match: (SOME\(.*\)|NONE\(\)) + - match: (SOME\(|NONE\(\)) name: entity.name.type # Function calls diff --git a/test/metamodelica/Option.test.mo b/test/metamodelica/Option.test.mo index 15c9fa2..e7a5eef 100644 --- a/test/metamodelica/Option.test.mo +++ b/test/metamodelica/Option.test.mo @@ -1,14 +1,6 @@ // SYNTAX TEST "source.metamodelica" "Option" -function f - input Option oi; -// ^^^^^^ source.metamodelica storage.type -// ^^^^^^^ source.metamodelica storage.type -algorithm - () := match oi - case SOME(i) then (); -// ^^^^ source.metamodelica entity.name.type - case NONE() then (); -// ^^^^ source.metamodelica entity.name.type - end match; -end f; +opt := if cond then SOME(i) else NONE(); +// ^^^^ source.metamodelica entity.name.type +// ^^^^ source.metamodelica keyword.control +// ^^^^ source.metamodelica entity.name.type