github-linguist 4.8.12 → 4.8.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1582,8 +1582,8 @@
1582
1582
  ".gemrc"
1583
1583
  ]
1584
1584
  },
1585
- "tokens_total": 1193509,
1586
- "languages_total": 1657,
1585
+ "tokens_total": 1193520,
1586
+ "languages_total": 1658,
1587
1587
  "tokens": {
1588
1588
  "1C Enterprise": {
1589
1589
  "&": 8,
@@ -31549,12 +31549,20 @@
31549
31549
  "hit": 2
31550
31550
  },
31551
31551
  "FORTRAN": {
31552
+ "Codes/HYCOM/hycom/ATLb2.00/src_2.0.01_22_one/": 1,
31553
+ "real": 1,
31554
+ "onemu": 1,
31555
+ "twomu": 1,
31556
+ "data": 3,
31557
+ "onemu/0.0098/": 1,
31558
+ "twomu/1./": 1,
31559
+ "threemu/0.e9/": 1,
31560
+ "end": 13,
31552
31561
  "c": 3,
31553
31562
  "comment": 8,
31554
31563
  "*": 4,
31555
31564
  "program": 3,
31556
31565
  "main": 3,
31557
- "end": 12,
31558
31566
  "subroutine": 3,
31559
31567
  "foo": 4,
31560
31568
  "(": 20,
@@ -134154,7 +134162,7 @@
134154
134162
  "Erlang": 7011,
134155
134163
  "F#": 3281,
134156
134164
  "FLUX": 1392,
134157
- "FORTRAN": 192,
134165
+ "FORTRAN": 203,
134158
134166
  "Filebench WML": 109,
134159
134167
  "Filterscript": 143,
134160
134168
  "Formatted": 5103,
@@ -134506,7 +134514,7 @@
134506
134514
  "Erlang": 13,
134507
134515
  "F#": 8,
134508
134516
  "FLUX": 4,
134509
- "FORTRAN": 4,
134517
+ "FORTRAN": 5,
134510
134518
  "Filebench WML": 1,
134511
134519
  "Filterscript": 2,
134512
134520
  "Formatted": 3,
@@ -134774,5 +134782,5 @@
134774
134782
  "wisp": 1,
134775
134783
  "xBase": 3
134776
134784
  },
134777
- "md5": "0a008661b849df1a884b7231ecb397f1"
134785
+ "md5": "622861cd377294bbe0f2ed68f111588a"
134778
134786
  }
@@ -1,19 +1,98 @@
1
1
  module Linguist
2
2
  module Strategy
3
3
  class Modeline
4
- EMACS_MODELINE = /-\*-\s*(?:(?!mode)[\w-]+\s*:\s*(?:[\w+-]+)\s*;?\s*)*(?:mode\s*:)?\s*([\w+-]+)\s*(?:;\s*(?!mode)[\w-]+\s*:\s*[\w+-]+\s*)*;?\s*-\*-/i
4
+ EMACS_MODELINE = /
5
+ -\*-
6
+ (?:
7
+ # Short form: `-*- ruby -*-`
8
+ \s* (?= [^:;\s]+ \s* -\*-)
9
+ |
10
+ # Longer form: `-*- foo:bar; mode: ruby; -*-`
11
+ (?:
12
+ .*? # Preceding variables: `-*- foo:bar bar:baz;`
13
+ [;\s] # Which are delimited by spaces or semicolons
14
+ |
15
+ (?<=-\*-) # Not preceded by anything: `-*-mode:ruby-*-`
16
+ )
17
+ mode # Major mode indicator
18
+ \s*:\s* # Allow whitespace around colon: `mode : ruby`
19
+ )
20
+ ([^:;\s]+) # Name of mode
5
21
 
6
- # First form vim modeline
7
- # [text]{white}{vi:|vim:|ex:}[white]{options}
8
- # ex: 'vim: syntax=ruby'
9
- VIM_MODELINE_1 = /(?:vim|vi|ex):\s*(?:ft|filetype|syntax)=(\w+)\s?/i
22
+ # Ensure the mode is terminated correctly
23
+ (?=
24
+ # Followed by semicolon or whitespace
25
+ [\s;]
26
+ |
27
+ # Touching the ending sequence: `ruby-*-`
28
+ (?<![-*]) # Don't allow stuff like `ruby--*-` to match; it'll invalidate the mode
29
+ -\*- # Emacs has no problems reading `ruby --*-`, however.
30
+ )
31
+ .*? # Anything between a cleanly-terminated mode and the ending -*-
32
+ -\*-
33
+ /xi
10
34
 
11
- # Second form vim modeline (compatible with some versions of Vi)
12
- # [text]{white}{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text]
13
- # ex: 'vim set syntax=ruby:'
14
- VIM_MODELINE_2 = /(?:vim|vi|Vim|ex):\s*se(?:t)?.*\s(?:ft|filetype|syntax)=(\w+)\s?.*:/i
35
+ VIM_MODELINE = /
15
36
 
16
- MODELINES = [EMACS_MODELINE, VIM_MODELINE_1, VIM_MODELINE_2]
37
+ # Start modeline. Could be `vim:`, `vi:` or `ex:`
38
+ (?:
39
+ (?:\s|^)
40
+ vi
41
+ (?:m[<=>]?\d+|m)? # Version-specific modeline
42
+ |
43
+ [\t\x20] # `ex:` requires whitespace, because "ex:" might be short for "example:"
44
+ ex
45
+ )
46
+
47
+ # If the option-list begins with `set ` or `se `, it indicates an alternative
48
+ # modeline syntax partly-compatible with older versions of Vi. Here, the colon
49
+ # serves as a terminator for an option sequence, delimited by whitespace.
50
+ (?=
51
+ # So we have to ensure the modeline ends with a colon
52
+ : (?=\s* set? \s [^\n:]+ :) |
53
+
54
+ # Otherwise, it isn't valid syntax and should be ignored
55
+ : (?!\s* set? \s)
56
+ )
57
+
58
+ # Possible (unrelated) `option=value` pairs to skip past
59
+ (?:
60
+ # Option separator. Vim uses whitespace or colons to separate options (except if
61
+ # the alternate "vim: set " form is used, where only whitespace is used)
62
+ (?:
63
+ \s
64
+ |
65
+ \s* : \s* # Note that whitespace around colons is accepted too:
66
+ ) # vim: noai : ft=ruby:noexpandtab
67
+
68
+ # Option's name. All recognised Vim options have an alphanumeric form.
69
+ \w*
70
+
71
+ # Possible value. Not every option takes an argument.
72
+ (?:
73
+ # Whitespace between name and value is allowed: `vim: ft =ruby`
74
+ \s*=
75
+
76
+ # Option's value. Might be blank; `vim: ft= ` says "use no filetype".
77
+ (?:
78
+ [^\\\s] # Beware of escaped characters: titlestring=\ ft=ruby
79
+ | # will be read by Vim as { titlestring: " ft=ruby" }.
80
+ \\.
81
+ )*
82
+ )?
83
+ )*
84
+
85
+ # The actual filetype declaration
86
+ [\s:] (?:filetype|ft|syntax) \s*=
87
+
88
+ # Language's name
89
+ (\w+)
90
+
91
+ # Ensure it's followed by a legal separator
92
+ (?=\s|:|$)
93
+ /xi
94
+
95
+ MODELINES = [EMACS_MODELINE, VIM_MODELINE]
17
96
 
18
97
  # Scope of the search for modelines
19
98
  # Number of lines to check at the beginning and at the end of the file
@@ -1,3 +1,3 @@
1
1
  module Linguist
2
- VERSION = "4.8.12"
2
+ VERSION = "4.8.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-linguist
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.8.12
4
+ version: 4.8.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-14 00:00:00.000000000 Z
11
+ date: 2016-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: charlock_holmes