Skip to content

Commit

Permalink
Add highlighting for ltls, per issue #3.
Browse files Browse the repository at this point in the history
  • Loading branch information
corbanmailloux committed Apr 30, 2014
1 parent 16e1cf6 commit 26c621f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
17 changes: 16 additions & 1 deletion Syntaxes/Promela.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ fileTypes: [pml, promela]
uuid: fa220c5d-0ad5-4a52-8027-37e13443b1fc

patterns:


# Comments
- comment: Block comment
name: comment.block
begin: '\/\*'
end: '\*\/'


# Flow Control
- comment: flow control
name: keyword.control
match: '\b(assert|else|fi|if|unless|xr|xs|do|od|break|skip|atomic)\b'


# Operators
- comment: operators
name: keyword.operator
Expand All @@ -34,19 +38,30 @@ patterns:
name: variable.other
match: '\b[a-zA-Z_]+[0-9a-zA-Z_]*(\s)*:'


# Functions
- comment: built-in functions
name: entity.name.function
match: '\b(printf|len|empty|nempty|full|nfull|enabled|eval|pc_value)\b'

- comment: Function calls
- comment: function calls
begin: '\b([a-zA-Z_]+[0-9a-zA-Z_]*)\('
beginCaptures:
'1': {name: entity.name.function}
end: '\)'
patterns:
- include: $self

- comment: ltls
begin: '\b(ltl)(\s)+([a-zA-Z_]+[0-9a-zA-Z_]*)(\s)*{'
beginCaptures:
'1': {name: storage.type}
'3': {name: entity.name.function}
end: '}'
patterns:
- include: $self


# Constants
- comment: string
name: string.quoted.double
Expand Down
30 changes: 29 additions & 1 deletion Syntaxes/Promela.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</dict>
</dict>
<key>comment</key>
<string>Function calls</string>
<string>function calls</string>
<key>end</key>
<string>\)</string>
<key>patterns</key>
Expand All @@ -95,6 +95,34 @@
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>\b(ltl)(\s)+([a-zA-Z_]+[0-9a-zA-Z_]*)(\s)*{</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.type</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>entity.name.function</string>
</dict>
</dict>
<key>comment</key>
<string>ltls</string>
<key>end</key>
<string>}</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>$self</string>
</dict>
</array>
</dict>
<dict>
<key>comment</key>
<string>string</string>
Expand Down

0 comments on commit 26c621f

Please sign in to comment.