Skip to content

Commit

Permalink
Merge pull request #21 from adius/master
Browse files Browse the repository at this point in the history
Make matches case insensitive
  • Loading branch information
princemaple authored Oct 2, 2017
2 parents c10c388 + 4898226 commit 41b5d53
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Syntaxes/Dockerfile.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@
name: Dockerfile
file_extensions:
- Dockerfile
first_line_match: \s*(FROM|ARG)\s
- dockerfile
first_line_match: \s*(?i:(from|arg))\s
scope: source.dockerfile

variables:
onbuild_directive: (?:(ONBUILD)\s+)?
onbuild_commands_directive: "{{onbuild_directive}}(?:ADD|ARG|ENV|EXPOSE|HEALTHCHECK|LABEL|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)"
nononbuild_commands_directive: MAINTAINER
runtime_directive: "{{onbuild_directive}}(?:CMD|ENTRYPOINT)"
from_directive: (FROM)\s+[^\s:@]+(?:[:@](\S+))?(?:\s+(AS)\s+(\S+))?
copy_directive: ({{onbuild_directive}}COPY)(?:\s+--from=(\S+))?
onbuild_directive: (?i:(onbuild)\s+)?
onbuild_commands_directive:
"{{onbuild_directive}}(?i:add|arg|env|expose|healthcheck|label|run|shell|stopsignal|user|volume|workdir)"
nononbuild_commands_directive: (?i:maintainer)
runtime_directive: "{{onbuild_directive}}(?i:cmd|entrypoint)"
from_directive: (?i:(from))\s+[^\s:@]+(?:[:@](\S+))?(?:\s+(?i:(as))\s+(\S+))?
copy_directive: ({{onbuild_directive}}(?i:copy))(?:\s+--from=(\S+))?

contexts:
main:
- include: comments
- match: ^ARG\s
- match: ^(?i:arg)\s
scope: keyword.control.dockerfile
- include: from

Expand Down

0 comments on commit 41b5d53

Please sign in to comment.