Skip to content

Commit

Permalink
Use begin/end rule for class definitions
Browse files Browse the repository at this point in the history
Fixes #28
  • Loading branch information
phannebohm committed Mar 13, 2024
1 parent 79ac3e4 commit 576e338
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions syntaxes/modelica.tmGrammar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ patterns:
- match: \b(extends|partial|within)\b
name: support.type

# Block definitions
- match: \b(model|class|record|block|package)\s+(\w+)\s*(".*")*
captures:
# Class definitions
- begin: \b(model|class|record|block|package|function)\s+(\w+)\s*(".*")*
beginCaptures:
1:
name: keyword
2:
name: entity.name.type
3:
name: comment.line
- match: \b(function)\s+(\w+)\s*(".*")*
captures:
end: \b(end)\s+(\2)\s*;
endCaptures:
1:
name: keyword
2:
name: entity.name.function
3:
name: comment.line
name: entity.name.type
patterns:
- include: "source.modelica"

# Annotations
- begin: \b(annotation)\b
Expand Down

0 comments on commit 576e338

Please sign in to comment.