Skip to content

Commit

Permalink
Update modeline patterns to use github-linguist/linguist#5271
Browse files Browse the repository at this point in the history
  • Loading branch information
Alhadis committed Mar 13, 2021
1 parent 57fdf8b commit bd4c23b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ This project honours [Semantic Versioning](http://semver.org).
[Staged]: https://github.com/Alhadis/language-webassembly/compare/v1.1.1...HEAD


[Staged]
------------------------------------------------------------------------
* __Fixed:__ [Various inaccuracies][1] related to modeline recognition

[1]: https://github.com/github/linguist/pull/5271


[v1.1.1]
------------------------------------------------------------------------
**December 20th, 2019**
Expand Down
16 changes: 9 additions & 7 deletions grammars/webassembly.cson
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ firstLineMatch: """(?x)
(?:$|\\s)
|
# Modeline
(?i:
(?:
# Emacs
-\\*-(?:\\s*(?=[^:;\\s]+\\s*-\\*-)|(?:.*?[;\\s]|(?<=-\\*-))mode\\s*:\\s*)
(?:wasm|wast|web[\\s-]?assembly)
(?=[\\s;]|(?<![-*])-\\*-).*?-\\*-
-\\*-(?i:[ \\t]*(?=[^:;\\s]+[ \\t]*-\\*-)|(?:.*?[ \\t;]|(?<=-\\*-))[ \\t]*mode[ \\t]*:[ \\t]*)
(?i:wasm|was?t|web[-_]?assembly)
(?=[ \\t;]|(?<![-*])-\\*-).*?-\\*-
|
# Vim
(?:(?:\\s|^)vi(?:m[<=>]?\\d+|m)?|\\sex)(?=:(?=\\s*set?\\s[^\\n:]+:)|:(?!\\s*set?\\s))(?:(?:\\s|\\s*:\\s*)\\w*(?:\\s*=(?:[^\\n\\\\\\s]|\\\\.)*)?)*[\\s:](?:filetype|ft|syntax)\\s*=
(?:wasm|wast|web[\\s-]?assembly)
(?=\\s|:|$)
(?:(?:^|[ \\t])(?:vi|Vi(?=m))(?:m[<=>]?[0-9]+|m)?|[ \\t]ex)(?=:(?=[ \\t]*set?[ \\t][^\\r\\n:]+:)|:(?![ \\t]*set?[ \\t]))
(?:(?:[ \\t]*:[ \\t]*|[ \\t])\\w*(?:[ \\t]*=(?:[^\\\\\\s]|\\\\.)*)?)*[ \\t:]
(?:filetype|ft|syntax)[ \\t]*=
(?i:wasm|was?t|web[-_]?assembly)
(?=$|\\s|:)
)
"""
patterns: [{
Expand Down

0 comments on commit bd4c23b

Please sign in to comment.