mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-25 18:55:35 +00:00
improve .ms disambiguation (Unix Assembly / MAXScript) (#3707)
A few MAXScript files were misclassified as Unix Assembly. Some of them can be found at github.com/davestewart/maxscript * This commit changes the heuristic which looked for labels such as ".LG7E0:" to actually match the full label including the colon. This reduced the number of MAXScript files misclassified as Unix Assembly, without any new Unix Assembly misclassified so far. * add MAXScript sample rolloutCreator.ms, extrated from MIT repo: https://github.com/davestewart/maxscript/blob/master/3D/3ds2ae/02_resources/max%20scripts/3ds%20ax%20scripts/rolloutCreator.ms
This commit is contained in:
committed by
Colin Seymour
parent
1a6df12902
commit
37979b26b0
@@ -297,7 +297,7 @@ module Linguist
|
||||
disambiguate ".ms" do |data|
|
||||
if /^[.'][a-z][a-z](\s|$)/i.match(data)
|
||||
Language["Roff"]
|
||||
elsif /(?<!\S)\.(include|globa?l)\s/.match(data) || /(?<!\/\*)(\A|\n)\s*\.[A-Za-z]/.match(data.gsub(/"([^\\"]|\\.)*"|'([^\\']|\\.)*'|\\\s*(?:--.*)?\n/, ""))
|
||||
elsif /(?<!\S)\.(include|globa?l)\s/.match(data) || /(?<!\/\*)(\A|\n)\s*\.[A-Za-z][_A-Za-z0-9]*:/.match(data.gsub(/"([^\\"]|\\.)*"|'([^\\']|\\.)*'|\\\s*(?:--.*)?\n/, ""))
|
||||
Language["Unix Assembly"]
|
||||
else
|
||||
Language["MAXScript"]
|
||||
|
||||
Reference in New Issue
Block a user