Skip to content

Commit

Permalink
improve case statement
Browse files Browse the repository at this point in the history
  • Loading branch information
315234 committed Jun 30, 2016
1 parent 162b95a commit 8c55913
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions grammars/FortranModern.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ contexts:
- include: block_statement
- include: block_data_statement
- include: call_statement
- include: case_statement
- include: coarrays
- include: comments
- include: common-block
Expand Down Expand Up @@ -252,6 +253,30 @@ contexts:
3: support.function.any-method
4: support.function.any-method
case_statement:
- match: (?xi:^ \s* case \b )
scope: keyword.control.case
push: case_selector
case_selector:
- include: pop-at-end-of-line
- match: (?xi:\s* default)
scope: keyword.control.default
pop: true
- match: \(
push:
# select case construct label:
- match: \)\s+({{ident}})
captures:
1: entity.name.tag.construct_name.fortran
pop: true
- match: \)
pop: true
- match: ":"
scope: keyword.operator.colon.fortran
- include: expression
- match: .*
scope: invalid.illegal

contains_statement:
- match: (?xi:^ \s* (contains) \b \s* ({{eol_comment}})? $)
captures:
Expand Down Expand Up @@ -851,8 +876,6 @@ contexts:
(?:
\b( assign
| then
| case\s+default
| case
| continue
| stop
| pause
Expand Down

0 comments on commit 8c55913

Please sign in to comment.