mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-05-23 16:40:08 -03:00
add .pp pascal/puppet disambiguation. (#4)
This commit is contained in:
parent
6043702bbc
commit
ceaab89baa
@ -293,6 +293,12 @@ var matchers = map[string]languageMatcher{
|
|||||||
|
|
||||||
return "Perl", false
|
return "Perl", false
|
||||||
},
|
},
|
||||||
|
".pp": func(i []byte) (string, bool) {
|
||||||
|
if pascalMatcher.Match(i) {
|
||||||
|
return "Pascal", true
|
||||||
|
}
|
||||||
|
return "Puppet", false
|
||||||
|
},
|
||||||
".t": func(i []byte) (string, bool) {
|
".t": func(i []byte) (string, bool) {
|
||||||
if perlMatcher.Match(i) {
|
if perlMatcher.Match(i) {
|
||||||
return "Perl", true
|
return "Perl", true
|
||||||
@ -461,7 +467,7 @@ var (
|
|||||||
matlabMatcher = substring.BytesRegexp(`\b(function\s*[\[a-zA-Z]+|pcolor|classdef|figure|end|elseif)\b`)
|
matlabMatcher = substring.BytesRegexp(`\b(function\s*[\[a-zA-Z]+|pcolor|classdef|figure|end|elseif)\b`)
|
||||||
objectiveCMatcher = substring.BytesRegexp(
|
objectiveCMatcher = substring.BytesRegexp(
|
||||||
`@(interface|class|protocol|property|end|synchronised|selector|implementation)\b|#import\s+.+\.h[">]`)
|
`@(interface|class|protocol|property|end|synchronised|selector|implementation)\b|#import\s+.+\.h[">]`)
|
||||||
|
pascalMatcher = substring.BytesRegexp(`(?ims)^\s*(PROGRAM|UNIT|USES|FUNCTION)[\s\n]+.*?;`)
|
||||||
prologMatcher = substring.BytesRegexp(`^[^#]+:-`)
|
prologMatcher = substring.BytesRegexp(`^[^#]+:-`)
|
||||||
perlMatcher = substring.BytesRegexp(`use strict|use\s+v?5\.`)
|
perlMatcher = substring.BytesRegexp(`use strict|use\s+v?5\.`)
|
||||||
perl6Matcher = substring.BytesRegexp(`(use v6|(my )?class|module)`)
|
perl6Matcher = substring.BytesRegexp(`(use v6|(my )?class|module)`)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user