mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add .x as XDR/RPCGEN (#3472)
* Add .x as XDR/RPCGEN XDR/RPC language as documented in RFC5531, RFC4506. Samples are from glibc and RFCs. * Add Logos samples https://github.com/JonasGessner/NoCarrier/blob/master/NoCarrier.x - MITcf31f4e466/llvm-gcc-R3/gcc/testsuite/objc/execute/string1.x- GPL2f6415578fa/perapp-plugin/Tweak.x- GPL3d1b3e83888/NCHax.x- Apache * Add disambiguate heuristics for .x * Add RPC to vendor/README.md
This commit is contained in:
committed by
Colin Seymour
parent
8da6ddf9d9
commit
60f748d47b
@@ -513,5 +513,13 @@ module Linguist
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate ".x" do |data|
|
||||
if /\b(program|version)\s+\w+\s*{|\bunion\s+\w+\s+switch\s*\(/.match(data)
|
||||
Language["RPC"]
|
||||
elsif /^%(end|ctor|hook|group)\b/.match(data)
|
||||
Language["Logos"]
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3753,6 +3753,17 @@ RMarkdown:
|
||||
- ".rmd"
|
||||
tm_scope: source.gfm
|
||||
language_id: 313
|
||||
RPC:
|
||||
type: programming
|
||||
aliases:
|
||||
- rpcgen
|
||||
- oncrpc
|
||||
- xdr
|
||||
ace_mode: c_cpp
|
||||
extensions:
|
||||
- ".x"
|
||||
tm_scope: source.c
|
||||
language_id: 1031374237
|
||||
RPM Spec:
|
||||
type: data
|
||||
tm_scope: source.rpm-spec
|
||||
|
||||
Reference in New Issue
Block a user