github-linguist 5.3.1 → 5.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/linguist/extconf.rb +3 -0
- data/ext/linguist/lex.linguist_yy.c +8269 -0
- data/ext/linguist/lex.linguist_yy.h +353 -0
- data/ext/linguist/linguist.c +64 -0
- data/ext/linguist/linguist.h +11 -0
- data/ext/linguist/tokenizer.l +119 -0
- data/grammars/source.coffee.json +123 -41
- data/grammars/source.crystal.json +2 -2
- data/grammars/source.css.less.json +319 -27
- data/grammars/source.glsl.json +1 -1
- data/grammars/source.js.json +6 -2
- data/grammars/source.meson.json +1 -1
- data/grammars/source.tsx.json +4 -14
- data/grammars/source.wdl.json +2 -2
- data/grammars/text.roff.json +155 -41
- data/grammars/text.shell-session.json +1 -1
- data/lib/linguist/blob_helper.rb +47 -4
- data/lib/linguist/classifier.rb +3 -1
- data/lib/linguist/file_blob.rb +3 -3
- data/lib/linguist/heuristics.rb +15 -6
- data/lib/linguist/linguist.bundle +0 -0
- data/lib/linguist/samples.json +49989 -44225
- data/lib/linguist/strategy/modeline.rb +2 -2
- data/lib/linguist/tokenizer.rb +1 -186
- data/lib/linguist/version.rb +1 -1
- metadata +25 -3
data/grammars/source.coffee.json
CHANGED
@@ -11,22 +11,22 @@
|
|
11
11
|
"firstLineMatch": "(?x)\n# Hashbang\n^\\#!.*(?:\\s|\\/)\n coffee\n(?:$|\\s)\n|\n# Modeline\n(?i:\n # Emacs\n -\\*-(?:\\s*(?=[^:;\\s]+\\s*-\\*-)|(?:.*?[;\\s]|(?<=-\\*-))mode\\s*:\\s*)\n coffee\n (?=[\\s;]|(?<![-*])-\\*-).*?-\\*-\n |\n # Vim\n (?:(?:\\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*=\n coffee\n (?=\\s|:|$)\n)",
|
12
12
|
"patterns": [
|
13
13
|
{
|
14
|
+
"match": "(new)\\s+(?:(?:(class)\\s+(\\w+(?:\\.\\w*)*)?)|(\\w+(?:\\.\\w*)*))",
|
15
|
+
"name": "meta.class.instance.constructor.coffee",
|
14
16
|
"captures": {
|
15
17
|
"1": {
|
16
18
|
"name": "keyword.operator.new.coffee"
|
17
19
|
},
|
18
|
-
"
|
20
|
+
"2": {
|
19
21
|
"name": "storage.type.class.coffee"
|
20
22
|
},
|
21
|
-
"
|
23
|
+
"3": {
|
22
24
|
"name": "entity.name.type.instance.coffee"
|
23
25
|
},
|
24
|
-
"
|
26
|
+
"4": {
|
25
27
|
"name": "entity.name.type.instance.coffee"
|
26
28
|
}
|
27
|
-
}
|
28
|
-
"match": "(new)\\s+(((class)(\\s+(\\w+(?:\\.\\w*)*))?)|(\\w+(?:\\.\\w*)*))",
|
29
|
-
"name": "meta.class.instance.constructor"
|
29
|
+
}
|
30
30
|
},
|
31
31
|
{
|
32
32
|
"begin": "'''",
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"name": "punctuation.definition.string.end.coffee"
|
42
42
|
}
|
43
43
|
},
|
44
|
-
"name": "string.quoted.heredoc.coffee",
|
44
|
+
"name": "string.quoted.single.heredoc.coffee",
|
45
45
|
"patterns": [
|
46
46
|
{
|
47
47
|
"captures": {
|
@@ -137,7 +137,7 @@
|
|
137
137
|
{
|
138
138
|
"begin": "///",
|
139
139
|
"end": "(///)[gimuy]*",
|
140
|
-
"name": "string.regexp.coffee",
|
140
|
+
"name": "string.regexp.multiline.coffee",
|
141
141
|
"beginCaptures": {
|
142
142
|
"0": {
|
143
143
|
"name": "punctuation.definition.string.begin.coffee"
|
@@ -529,13 +529,13 @@
|
|
529
529
|
"arguments": {
|
530
530
|
"patterns": [
|
531
531
|
{
|
532
|
-
"begin": "
|
532
|
+
"begin": "\\(",
|
533
533
|
"beginCaptures": {
|
534
534
|
"0": {
|
535
535
|
"name": "punctuation.definition.arguments.begin.bracket.round.coffee"
|
536
536
|
}
|
537
537
|
},
|
538
|
-
"end": "\\)
|
538
|
+
"end": "\\)",
|
539
539
|
"endCaptures": {
|
540
540
|
"0": {
|
541
541
|
"name": "punctuation.definition.arguments.end.bracket.round.coffee"
|
@@ -547,6 +547,16 @@
|
|
547
547
|
"include": "$self"
|
548
548
|
}
|
549
549
|
]
|
550
|
+
},
|
551
|
+
{
|
552
|
+
"begin": "(?=(@|@?[\\w$]+|[=-]>|\\-\\d|\\[|{|\"|'))",
|
553
|
+
"end": "(?=\\s*(?<![\\w$])(of|in|then|is|isnt|and|or|for|else|when|if|unless|by|instanceof)(?![\\w$]))|(?=\\s*(}|\\]|\\)|#|$))",
|
554
|
+
"name": "meta.arguments.coffee",
|
555
|
+
"patterns": [
|
556
|
+
{
|
557
|
+
"include": "$self"
|
558
|
+
}
|
559
|
+
]
|
550
560
|
}
|
551
561
|
]
|
552
562
|
},
|
@@ -586,7 +596,7 @@
|
|
586
596
|
"function_calls": {
|
587
597
|
"patterns": [
|
588
598
|
{
|
589
|
-
"begin": "(
|
599
|
+
"begin": "(@)?([\\w$]+)(?=\\()",
|
590
600
|
"beginCaptures": {
|
591
601
|
"1": {
|
592
602
|
"name": "variable.other.readwrite.instance.coffee"
|
@@ -594,21 +604,34 @@
|
|
594
604
|
"2": {
|
595
605
|
"patterns": [
|
596
606
|
{
|
597
|
-
"
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
607
|
+
"include": "#function_names"
|
608
|
+
}
|
609
|
+
]
|
610
|
+
}
|
611
|
+
},
|
612
|
+
"end": "(?<=\\))",
|
613
|
+
"name": "meta.function-call.coffee",
|
614
|
+
"patterns": [
|
615
|
+
{
|
616
|
+
"include": "#arguments"
|
617
|
+
}
|
618
|
+
]
|
619
|
+
},
|
620
|
+
{
|
621
|
+
"begin": "(?x)\n(@)?([\\w$]+)\n\\s*\n(?=\\s+(?!(?<![\\w$])(of|in|then|is|isnt|and|or|for|else|when|if|unless|by|instanceof)(?![\\w$]))(?=(@?[\\w$]+|[=-]>|\\-\\d|\\[|{|\"|')))",
|
622
|
+
"beginCaptures": {
|
623
|
+
"1": {
|
624
|
+
"name": "variable.other.readwrite.instance.coffee"
|
625
|
+
},
|
626
|
+
"2": {
|
627
|
+
"patterns": [
|
604
628
|
{
|
605
|
-
"
|
606
|
-
"name": "invalid.illegal.identifier.coffee"
|
629
|
+
"include": "#function_names"
|
607
630
|
}
|
608
631
|
]
|
609
632
|
}
|
610
633
|
},
|
611
|
-
"end": "(
|
634
|
+
"end": "(?=\\s*(?<![\\w$])(of|in|then|is|isnt|and|or|for|else|when|if|unless|by|instanceof)(?![\\w$]))|(?=\\s*(}|\\]|\\)|#|$))",
|
612
635
|
"name": "meta.function-call.coffee",
|
613
636
|
"patterns": [
|
614
637
|
{
|
@@ -618,6 +641,22 @@
|
|
618
641
|
}
|
619
642
|
]
|
620
643
|
},
|
644
|
+
"function_names": {
|
645
|
+
"patterns": [
|
646
|
+
{
|
647
|
+
"match": "(?x)\n\\b(isNaN|isFinite|eval|uneval|parseInt|parseFloat|decodeURI|\ndecodeURIComponent|encodeURI|encodeURIComponent|escape|unescape|\nrequire|set(Interval|Timeout)|clear(Interval|Timeout))\\b",
|
648
|
+
"name": "support.function.coffee"
|
649
|
+
},
|
650
|
+
{
|
651
|
+
"match": "[a-zA-Z_$][\\w$]*",
|
652
|
+
"name": "entity.name.function.coffee"
|
653
|
+
},
|
654
|
+
{
|
655
|
+
"match": "\\d[\\w$]*",
|
656
|
+
"name": "invalid.illegal.identifier.coffee"
|
657
|
+
}
|
658
|
+
]
|
659
|
+
},
|
621
660
|
"function_params": {
|
622
661
|
"patterns": [
|
623
662
|
{
|
@@ -707,7 +746,7 @@
|
|
707
746
|
"method_calls": {
|
708
747
|
"patterns": [
|
709
748
|
{
|
710
|
-
"begin": "(?:(\\.)|(::))\\s*([\\w$]+)\\s*(?=\\
|
749
|
+
"begin": "(?:(\\.)|(::))\\s*([\\w$]+)\\s*(?=\\()",
|
711
750
|
"beginCaptures": {
|
712
751
|
"1": {
|
713
752
|
"name": "punctuation.separator.method.period.coffee"
|
@@ -718,29 +757,37 @@
|
|
718
757
|
"3": {
|
719
758
|
"patterns": [
|
720
759
|
{
|
721
|
-
"
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
760
|
+
"include": "#method_names"
|
761
|
+
}
|
762
|
+
]
|
763
|
+
}
|
764
|
+
},
|
765
|
+
"end": "(?<=\\))",
|
766
|
+
"name": "meta.method-call.coffee",
|
767
|
+
"patterns": [
|
768
|
+
{
|
769
|
+
"include": "#arguments"
|
770
|
+
}
|
771
|
+
]
|
772
|
+
},
|
773
|
+
{
|
774
|
+
"begin": "(?:(\\.)|(::))\\s*([\\w$]+)\\s*(?=\\s+(?!(?<![\\w$])(of|in|then|is|isnt|and|or|for|else|when|if|unless|by|instanceof)(?![\\w$]))(?=(@|@?[\\w$]+|[=-]>|\\-\\d|\\[|{|\"|')))",
|
775
|
+
"beginCaptures": {
|
776
|
+
"1": {
|
777
|
+
"name": "punctuation.separator.method.period.coffee"
|
778
|
+
},
|
779
|
+
"2": {
|
780
|
+
"name": "keyword.operator.prototype.coffee"
|
781
|
+
},
|
782
|
+
"3": {
|
783
|
+
"patterns": [
|
736
784
|
{
|
737
|
-
"
|
738
|
-
"name": "invalid.illegal.identifier.coffee"
|
785
|
+
"include": "#method_names"
|
739
786
|
}
|
740
787
|
]
|
741
788
|
}
|
742
789
|
},
|
743
|
-
"end": "(
|
790
|
+
"end": "(?=\\s*(?<![\\w$])(of|in|then|is|isnt|and|or|for|else|when|if|unless|by|instanceof)(?![\\w$]))|(?=\\s*(}|\\]|\\)|#|$))",
|
744
791
|
"name": "meta.method-call.coffee",
|
745
792
|
"patterns": [
|
746
793
|
{
|
@@ -750,6 +797,30 @@
|
|
750
797
|
}
|
751
798
|
]
|
752
799
|
},
|
800
|
+
"method_names": {
|
801
|
+
"patterns": [
|
802
|
+
{
|
803
|
+
"match": "(?x)\n\\bon(Rowsinserted|Rowsdelete|Rowenter|Rowexit|Resize|Resizestart|Resizeend|Reset|\nReadystatechange|Mouseout|Mouseover|Mousedown|Mouseup|Mousemove|\nBefore(cut|deactivate|unload|update|paste|print|editfocus|activate)|\nBlur|Scrolltop|Submit|Select|Selectstart|Selectionchange|Hover|Help|\nChange|Contextmenu|Controlselect|Cut|Cellchange|Clock|Close|Deactivate|\nDatasetchanged|Datasetcomplete|Dataavailable|Drop|Drag|Dragstart|Dragover|\nDragdrop|Dragenter|Dragend|Dragleave|Dblclick|Unload|Paste|Propertychange|Error|\nErrorupdate|Keydown|Keyup|Keypress|Focus|Load|Activate|Afterupdate|Afterprint|Abort)\\b",
|
804
|
+
"name": "support.function.event-handler.coffee"
|
805
|
+
},
|
806
|
+
{
|
807
|
+
"match": "(?x)\n\\b(shift|showModelessDialog|showModalDialog|showHelp|scroll|scrollX|scrollByPages|\nscrollByLines|scrollY|scrollTo|stop|strike|sizeToContent|sidebar|signText|sort|\nsup|sub|substr|substring|splice|split|send|set(Milliseconds|Seconds|Minutes|Hours|\nMonth|Year|FullYear|Date|UTC(Milliseconds|Seconds|Minutes|Hours|Month|FullYear|Date)|\nTime|Hotkeys|Cursor|ZOptions|Active|Resizable|RequestHeader)|search|slice|\nsavePreferences|small|home|handleEvent|navigate|char|charCodeAt|charAt|concat|\ncontextual|confirm|compile|clear|captureEvents|call|createStyleSheet|createPopup|\ncreateEventObject|to(GMTString|UTCString|String|Source|UpperCase|LowerCase|LocaleString)|\ntest|taint|taintEnabled|indexOf|italics|disableExternalCapture|dump|detachEvent|unshift|\nuntaint|unwatch|updateCommands|join|javaEnabled|pop|push|plugins.refresh|paddings|parse|\nprint|prompt|preference|enableExternalCapture|exec|execScript|valueOf|UTC|find|file|\nfileModifiedDate|fileSize|fileCreatedDate|fileUpdatedDate|fixed|fontsize|fontcolor|\nforward|fromCharCode|watch|link|load|lastIndexOf|anchor|attachEvent|atob|apply|alert|\nabort|routeEvents|resize|resizeBy|resizeTo|recalc|returnValue|replace|reverse|reload|\nreleaseCapture|releaseEvents|go|get(Milliseconds|Seconds|Minutes|Hours|Month|Day|Year|FullYear|\nTime|Date|TimezoneOffset|UTC(Milliseconds|Seconds|Minutes|Hours|Day|Month|FullYear|Date)|\nAttention|Selection|ResponseHeader|AllResponseHeaders)|moveBy|moveBelow|moveTo|\nmoveToAbsolute|moveAbove|mergeAttributes|match|margins|btoa|big|bold|borderWidths|blink|back)\\b",
|
808
|
+
"name": "support.function.coffee"
|
809
|
+
},
|
810
|
+
{
|
811
|
+
"match": "(?x)\n\\b(acceptNode|add|addEventListener|addTextTrack|adoptNode|after|animate|append|\nappendChild|appendData|before|blur|canPlayType|captureStream|\ncaretPositionFromPoint|caretRangeFromPoint|checkValidity|clear|click|\ncloneContents|cloneNode|cloneRange|close|closest|collapse|\ncompareBoundaryPoints|compareDocumentPosition|comparePoint|contains|\nconvertPointFromNode|convertQuadFromNode|convertRectFromNode|createAttribute|\ncreateAttributeNS|createCaption|createCDATASection|createComment|\ncreateContextualFragment|createDocument|createDocumentFragment|\ncreateDocumentType|createElement|createElementNS|createEntityReference|\ncreateEvent|createExpression|createHTMLDocument|createNodeIterator|\ncreateNSResolver|createProcessingInstruction|createRange|createShadowRoot|\ncreateTBody|createTextNode|createTFoot|createTHead|createTreeWalker|delete|\ndeleteCaption|deleteCell|deleteContents|deleteData|deleteRow|deleteTFoot|\ndeleteTHead|detach|disconnect|dispatchEvent|elementFromPoint|elementsFromPoint|\nenableStyleSheetsForSet|entries|evaluate|execCommand|exitFullscreen|\nexitPointerLock|expand|extractContents|fastSeek|firstChild|focus|forEach|get|\ngetAll|getAnimations|getAttribute|getAttributeNames|getAttributeNode|\ngetAttributeNodeNS|getAttributeNS|getBoundingClientRect|getBoxQuads|\ngetClientRects|getContext|getDestinationInsertionPoints|getElementById|\ngetElementsByClassName|getElementsByName|getElementsByTagName|\ngetElementsByTagNameNS|getItem|getNamedItem|getSelection|getStartDate|\ngetVideoPlaybackQuality|has|hasAttribute|hasAttributeNS|hasAttributes|\nhasChildNodes|hasFeature|hasFocus|importNode|initEvent|insertAdjacentElement|\ninsertAdjacentHTML|insertAdjacentText|insertBefore|insertCell|insertData|\ninsertNode|insertRow|intersectsNode|isDefaultNamespace|isEqualNode|\nisPointInRange|isSameNode|item|key|keys|lastChild|load|lookupNamespaceURI|\nlookupPrefix|matches|move|moveAttribute|moveAttributeNode|moveChild|\nmoveNamedItem|namedItem|nextNode|nextSibling|normalize|observe|open|\nparentNode|pause|play|postMessage|prepend|preventDefault|previousNode|\npreviousSibling|probablySupportsContext|queryCommandEnabled|\nqueryCommandIndeterm|queryCommandState|queryCommandSupported|queryCommandValue|\nquerySelector|querySelectorAll|registerContentHandler|registerElement|\nregisterProtocolHandler|releaseCapture|releaseEvents|remove|removeAttribute|\nremoveAttributeNode|removeAttributeNS|removeChild|removeEventListener|\nremoveItem|replace|replaceChild|replaceData|replaceWith|reportValidity|\nrequestFullscreen|requestPointerLock|reset|scroll|scrollBy|scrollIntoView|\nscrollTo|seekToNextFrame|select|selectNode|selectNodeContents|set|setAttribute|\nsetAttributeNode|setAttributeNodeNS|setAttributeNS|setCapture|\nsetCustomValidity|setEnd|setEndAfter|setEndBefore|setItem|setNamedItem|\nsetRangeText|setSelectionRange|setSinkId|setStart|setStartAfter|setStartBefore|\nslice|splitText|stepDown|stepUp|stopImmediatePropagation|stopPropagation|\nsubmit|substringData|supports|surroundContents|takeRecords|terminate|toBlob|\ntoDataURL|toggle|toString|values|write|writeln)\\b",
|
812
|
+
"name": "support.function.dom.coffee"
|
813
|
+
},
|
814
|
+
{
|
815
|
+
"match": "[a-zA-Z_$][\\w$]*",
|
816
|
+
"name": "entity.name.function.coffee"
|
817
|
+
},
|
818
|
+
{
|
819
|
+
"match": "\\d[\\w$]*",
|
820
|
+
"name": "invalid.illegal.identifier.coffee"
|
821
|
+
}
|
822
|
+
]
|
823
|
+
},
|
753
824
|
"numbers": {
|
754
825
|
"patterns": [
|
755
826
|
{
|
@@ -807,7 +878,18 @@
|
|
807
878
|
"operators": {
|
808
879
|
"patterns": [
|
809
880
|
{
|
810
|
-
"match": "([a-zA-Z$_][\\w$]*)?\\s
|
881
|
+
"match": "(?:([a-zA-Z$_][\\w$]*)?\\s+|(?<![\\w$]))(and=|or=)",
|
882
|
+
"captures": {
|
883
|
+
"1": {
|
884
|
+
"name": "variable.assignment.coffee"
|
885
|
+
},
|
886
|
+
"2": {
|
887
|
+
"name": "keyword.operator.assignment.compound.coffee"
|
888
|
+
}
|
889
|
+
}
|
890
|
+
},
|
891
|
+
{
|
892
|
+
"match": "([a-zA-Z$_][\\w$]*)?\\s*(%=|\\+=|-=|\\*=|&&=|\\|\\|=|\\?=|(?<!\\()/=)",
|
811
893
|
"captures": {
|
812
894
|
"1": {
|
813
895
|
"name": "variable.assignment.coffee"
|
@@ -34,7 +34,7 @@
|
|
34
34
|
"name": "entity.other.inherited-class.crystal"
|
35
35
|
}
|
36
36
|
},
|
37
|
-
"match": "^\\s*(?:(abstract)\\s+)?(class|struct)\\s+([.\\w\\d_:]+)(?:(\\()([.\\w\\d_:]+)(\\)))?(?:\\s+(<)\\s+([.\\w\\d_:]+))?",
|
37
|
+
"match": "^\\s*(?:(abstract)\\s+)?(class|struct|def)\\s+([.\\w\\d_:]+)(?:(\\()([.\\w\\d_:]+)(\\)))?(?:\\s+(<)\\s+([.\\w\\d_:]+))?",
|
38
38
|
"name": "meta.class.crystal"
|
39
39
|
},
|
40
40
|
{
|
@@ -113,7 +113,7 @@
|
|
113
113
|
},
|
114
114
|
{
|
115
115
|
"comment": "everything being a reserved word, not a value and needing a 'end' is a..",
|
116
|
-
"match": "(?<!\\.)\\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|for|if|ifdef|in|module|rescue|struct|then|unless|until|when|while)\\b(?![?!])",
|
116
|
+
"match": "(?<!\\.)\\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|forall|for|if|ifdef|in|module|rescue|struct|then|unless|until|when|while)\\b(?![?!])",
|
117
117
|
"name": "keyword.control.crystal"
|
118
118
|
},
|
119
119
|
{
|
@@ -14,12 +14,7 @@
|
|
14
14
|
"include": "#strings"
|
15
15
|
},
|
16
16
|
{
|
17
|
-
"
|
18
|
-
"1": {
|
19
|
-
"name": "entity.other.attribute-name.class.mixin.css"
|
20
|
-
}
|
21
|
-
},
|
22
|
-
"match": "(\\.[_a-zA-Z][a-zA-Z0-9_-]*(?=\\())"
|
17
|
+
"include": "#mixins"
|
23
18
|
},
|
24
19
|
{
|
25
20
|
"captures": {
|
@@ -276,13 +271,7 @@
|
|
276
271
|
]
|
277
272
|
},
|
278
273
|
{
|
279
|
-
"
|
280
|
-
"name": "variable.other.less",
|
281
|
-
"captures": {
|
282
|
-
"1": {
|
283
|
-
"name": "punctuation.definition.variable.less"
|
284
|
-
}
|
285
|
-
}
|
274
|
+
"include": "#variables"
|
286
275
|
},
|
287
276
|
{
|
288
277
|
"include": "#variable_interpolation"
|
@@ -333,12 +322,10 @@
|
|
333
322
|
"name": "keyword.other.important.css"
|
334
323
|
},
|
335
324
|
{
|
336
|
-
"
|
337
|
-
"name": "keyword.operator.less"
|
325
|
+
"include": "#operators"
|
338
326
|
},
|
339
327
|
{
|
340
|
-
"
|
341
|
-
"name": "keyword.control.logical.operator.less"
|
328
|
+
"include": "#logical_operators"
|
342
329
|
},
|
343
330
|
{
|
344
331
|
"include": "source.css#tag-names"
|
@@ -385,20 +372,13 @@
|
|
385
372
|
"name": "punctuation.separator.key-value.css"
|
386
373
|
},
|
387
374
|
{
|
388
|
-
"
|
389
|
-
"name": "constant.language.boolean.less"
|
390
|
-
},
|
391
|
-
{
|
392
|
-
"match": "\\bdefault\\b",
|
393
|
-
"name": "support.function.default.less"
|
375
|
+
"include": "#booleans"
|
394
376
|
},
|
395
377
|
{
|
396
|
-
"
|
397
|
-
"name": "support.function.type-checking.less"
|
378
|
+
"include": "#function_type_checking"
|
398
379
|
},
|
399
380
|
{
|
400
|
-
"
|
401
|
-
"name": "support.function.unit-checking.less"
|
381
|
+
"include": "#function_unit_checking"
|
402
382
|
},
|
403
383
|
{
|
404
384
|
"include": "source.css#property-keywords"
|
@@ -417,6 +397,19 @@
|
|
417
397
|
}
|
418
398
|
],
|
419
399
|
"repository": {
|
400
|
+
"booleans": {
|
401
|
+
"match": "\\btrue\\b",
|
402
|
+
"name": "constant.language.boolean.less"
|
403
|
+
},
|
404
|
+
"variables": {
|
405
|
+
"match": "(@|\\-\\-)[\\w-]+",
|
406
|
+
"name": "variable.other.less",
|
407
|
+
"captures": {
|
408
|
+
"1": {
|
409
|
+
"name": "punctuation.definition.variable.less"
|
410
|
+
}
|
411
|
+
}
|
412
|
+
},
|
420
413
|
"variable_interpolation": {
|
421
414
|
"match": "@{[a-zA-Z0-9_-]+}",
|
422
415
|
"name": "variable.other.interpolation.less"
|
@@ -477,6 +470,14 @@
|
|
477
470
|
"match": "\\(|\\)",
|
478
471
|
"name": "meta.brace.round.css"
|
479
472
|
},
|
473
|
+
"operators": {
|
474
|
+
"match": "\\*|\\/|\\-|\\+|~|=|<=|>=|<|>",
|
475
|
+
"name": "keyword.operator.less"
|
476
|
+
},
|
477
|
+
"logical_operators": {
|
478
|
+
"match": "\\b(not|and|when)\\b",
|
479
|
+
"name": "keyword.control.logical.operator.less"
|
480
|
+
},
|
480
481
|
"property_values": {
|
481
482
|
"begin": "(?<!&)(:)\\s*(?!(\\s*{))(?!.*(?<!@){)",
|
482
483
|
"beginCaptures": {
|
@@ -539,6 +540,297 @@
|
|
539
540
|
"less_builtin_functions": {
|
540
541
|
"match": "\\b(abs|acos|alpha|argb|asin|atan|average|blue|calc|ceil|color|contrast|convert|convert|cos|darken|data-uri|desaturate|difference|e|escape|exclusion|extract|fade|fadein|fadeout|floor|format|green|greyscale|hardlight|hsl|hsla|hsv|hsva|hsvhue|hsvsaturation|hsvvalue|hue|length|lighten|lightness|luma|max|min|mix|mod|multiply|negation|overlay|percentage|pi|pow|red|replace|round|saturate|saturation|screen|sin|softlight|spin|sqrt|tan|unit)\\b",
|
541
542
|
"name": "support.function.any-method.builtin.less"
|
543
|
+
},
|
544
|
+
"function_type_checking": {
|
545
|
+
"begin": "\\b(isurl|isstring|isnumber|iskeyword|iscolor)(\\()",
|
546
|
+
"beginCaptures": {
|
547
|
+
"1": {
|
548
|
+
"name": "support.function.type-checking.less"
|
549
|
+
},
|
550
|
+
"2": {
|
551
|
+
"name": "meta.brace.round.css"
|
552
|
+
}
|
553
|
+
},
|
554
|
+
"end": "\\)",
|
555
|
+
"endCaptures": {
|
556
|
+
"0": {
|
557
|
+
"name": "meta.brace.round.css"
|
558
|
+
}
|
559
|
+
},
|
560
|
+
"patterns": [
|
561
|
+
{
|
562
|
+
"include": "#property_values"
|
563
|
+
},
|
564
|
+
{
|
565
|
+
"include": "#variables"
|
566
|
+
}
|
567
|
+
]
|
568
|
+
},
|
569
|
+
"function_default": {
|
570
|
+
"match": "\\b(default)(\\()(\\))",
|
571
|
+
"captures": {
|
572
|
+
"1": {
|
573
|
+
"name": "support.function.default.less"
|
574
|
+
},
|
575
|
+
"2": {
|
576
|
+
"name": "meta.brace.round.css"
|
577
|
+
},
|
578
|
+
"3": {
|
579
|
+
"name": "meta.brace.round.css"
|
580
|
+
}
|
581
|
+
}
|
582
|
+
},
|
583
|
+
"function_unit_checking": {
|
584
|
+
"begin": "\\b(isunit|ispixel|ispercentage|isem)(\\()",
|
585
|
+
"beginCaptures": {
|
586
|
+
"1": {
|
587
|
+
"name": "support.function.unit-checking.less"
|
588
|
+
},
|
589
|
+
"2": {
|
590
|
+
"name": "meta.brace.round.css"
|
591
|
+
}
|
592
|
+
},
|
593
|
+
"end": "\\)",
|
594
|
+
"endCaptures": {
|
595
|
+
"0": {
|
596
|
+
"name": "meta.brace.round.css"
|
597
|
+
}
|
598
|
+
},
|
599
|
+
"patterns": [
|
600
|
+
{
|
601
|
+
"include": "#property_values"
|
602
|
+
},
|
603
|
+
{
|
604
|
+
"include": "#variables"
|
605
|
+
}
|
606
|
+
]
|
607
|
+
},
|
608
|
+
"mixins": {
|
609
|
+
"name": "meta.mixin.less",
|
610
|
+
"begin": "((\\.)[_a-zA-Z][a-zA-Z0-9_-]*)(?=\\s*\\()",
|
611
|
+
"beginCaptures": {
|
612
|
+
"0": {
|
613
|
+
"name": "meta.definition.mixin.less"
|
614
|
+
},
|
615
|
+
"1": {
|
616
|
+
"name": "entity.name.mixin.less"
|
617
|
+
},
|
618
|
+
"2": {
|
619
|
+
"name": "punctuation.definition.mixin.less"
|
620
|
+
}
|
621
|
+
},
|
622
|
+
"end": "(?<=})",
|
623
|
+
"patterns": [
|
624
|
+
{
|
625
|
+
"include": "#mixin_parameters"
|
626
|
+
},
|
627
|
+
{
|
628
|
+
"include": "#mixin_guards"
|
629
|
+
},
|
630
|
+
{
|
631
|
+
"include": "$self"
|
632
|
+
}
|
633
|
+
]
|
634
|
+
},
|
635
|
+
"mixin_parameters": {
|
636
|
+
"name": "meta.parameters.less",
|
637
|
+
"begin": "\\((?=\\s*@|\\))",
|
638
|
+
"beginCaptures": {
|
639
|
+
"0": {
|
640
|
+
"name": "punctuation.definition.parameters.begin.bracket.round.less"
|
641
|
+
}
|
642
|
+
},
|
643
|
+
"end": "\\)",
|
644
|
+
"endCaptures": {
|
645
|
+
"0": {
|
646
|
+
"name": "punctuation.definition.parameters.end.bracket.round.less"
|
647
|
+
}
|
648
|
+
},
|
649
|
+
"patterns": [
|
650
|
+
{
|
651
|
+
"include": "#mixin_parameter_semicolon"
|
652
|
+
},
|
653
|
+
{
|
654
|
+
"include": "#mixin_parameter_comma"
|
655
|
+
},
|
656
|
+
{
|
657
|
+
"include": "#mixin_parameter"
|
658
|
+
}
|
659
|
+
]
|
660
|
+
},
|
661
|
+
"mixin_parameter_semicolon": {
|
662
|
+
"begin": "(@)[a-zA-Z][a-zA-Z0-9-]*(?=.*?;)",
|
663
|
+
"beginCaptures": {
|
664
|
+
"0": {
|
665
|
+
"name": "variable.parameter.less"
|
666
|
+
},
|
667
|
+
"1": {
|
668
|
+
"name": "punctuation.definition.variable.less"
|
669
|
+
}
|
670
|
+
},
|
671
|
+
"end": ";",
|
672
|
+
"endCaptures": {
|
673
|
+
"0": {
|
674
|
+
"name": "punctuation.separator.parameter.less"
|
675
|
+
}
|
676
|
+
},
|
677
|
+
"patterns": [
|
678
|
+
{
|
679
|
+
"match": ":",
|
680
|
+
"name": "punctuation.separator.key-value.less"
|
681
|
+
},
|
682
|
+
{
|
683
|
+
"include": "source.css#numeric-values"
|
684
|
+
},
|
685
|
+
{
|
686
|
+
"include": "source.css#color-keywords"
|
687
|
+
},
|
688
|
+
{
|
689
|
+
"include": "source.css#functions"
|
690
|
+
},
|
691
|
+
{
|
692
|
+
"include": "#less_builtin_functions"
|
693
|
+
},
|
694
|
+
{
|
695
|
+
"include": "source.css#property-keywords"
|
696
|
+
},
|
697
|
+
{
|
698
|
+
"include": "#strings"
|
699
|
+
},
|
700
|
+
{
|
701
|
+
"include": "source.css#commas"
|
702
|
+
}
|
703
|
+
]
|
704
|
+
},
|
705
|
+
"mixin_parameter_comma": {
|
706
|
+
"begin": "(@)[a-zA-Z][a-zA-Z0-9-]*(?=.*?,\\s*@)",
|
707
|
+
"beginCaptures": {
|
708
|
+
"0": {
|
709
|
+
"name": "variable.parameter.less"
|
710
|
+
},
|
711
|
+
"1": {
|
712
|
+
"name": "punctuation.definition.variable.less"
|
713
|
+
}
|
714
|
+
},
|
715
|
+
"end": ",(?=\\s*@)",
|
716
|
+
"endCaptures": {
|
717
|
+
"0": {
|
718
|
+
"name": "punctuation.separator.parameter.less"
|
719
|
+
}
|
720
|
+
},
|
721
|
+
"patterns": [
|
722
|
+
{
|
723
|
+
"match": ":",
|
724
|
+
"name": "punctuation.separator.key-value.less"
|
725
|
+
},
|
726
|
+
{
|
727
|
+
"include": "source.css#numeric-values"
|
728
|
+
},
|
729
|
+
{
|
730
|
+
"include": "source.css#color-keywords"
|
731
|
+
},
|
732
|
+
{
|
733
|
+
"include": "source.css#functions"
|
734
|
+
},
|
735
|
+
{
|
736
|
+
"include": "#less_builtin_functions"
|
737
|
+
},
|
738
|
+
{
|
739
|
+
"include": "source.css#property-keywords"
|
740
|
+
},
|
741
|
+
{
|
742
|
+
"include": "#strings"
|
743
|
+
}
|
744
|
+
]
|
745
|
+
},
|
746
|
+
"mixin_parameter": {
|
747
|
+
"begin": "(@)[a-zA-Z][a-zA-Z0-9-]*",
|
748
|
+
"beginCaptures": {
|
749
|
+
"0": {
|
750
|
+
"name": "variable.parameter.less"
|
751
|
+
},
|
752
|
+
"1": {
|
753
|
+
"name": "punctuation.definition.variable.less"
|
754
|
+
}
|
755
|
+
},
|
756
|
+
"end": "(?=\\))",
|
757
|
+
"patterns": [
|
758
|
+
{
|
759
|
+
"match": ":",
|
760
|
+
"name": "punctuation.separator.key-value.less"
|
761
|
+
},
|
762
|
+
{
|
763
|
+
"include": "source.css#numeric-values"
|
764
|
+
},
|
765
|
+
{
|
766
|
+
"include": "source.css#color-keywords"
|
767
|
+
},
|
768
|
+
{
|
769
|
+
"include": "source.css#functions"
|
770
|
+
},
|
771
|
+
{
|
772
|
+
"include": "#less_builtin_functions"
|
773
|
+
},
|
774
|
+
{
|
775
|
+
"include": "source.css#property-keywords"
|
776
|
+
},
|
777
|
+
{
|
778
|
+
"include": "#strings"
|
779
|
+
},
|
780
|
+
{
|
781
|
+
"include": "source.css#commas"
|
782
|
+
}
|
783
|
+
]
|
784
|
+
},
|
785
|
+
"mixin_guards": {
|
786
|
+
"name": "meta.guard.less",
|
787
|
+
"begin": "(?:(when|and|when\\s+not|and\\s+not)\\s*|(,)\\s*)+(\\()",
|
788
|
+
"beginCaptures": {
|
789
|
+
"1": {
|
790
|
+
"name": "keyword.control.logical.operator.less"
|
791
|
+
},
|
792
|
+
"2": {
|
793
|
+
"name": "punctuation.separator.list.comma.css"
|
794
|
+
},
|
795
|
+
"3": {
|
796
|
+
"name": "meta.brace.round.css"
|
797
|
+
}
|
798
|
+
},
|
799
|
+
"end": "\\)",
|
800
|
+
"endCaptures": {
|
801
|
+
"0": {
|
802
|
+
"name": "meta.brace.round.css"
|
803
|
+
}
|
804
|
+
},
|
805
|
+
"patterns": [
|
806
|
+
{
|
807
|
+
"include": "#function_type_checking"
|
808
|
+
},
|
809
|
+
{
|
810
|
+
"include": "#function_default"
|
811
|
+
},
|
812
|
+
{
|
813
|
+
"include": "#function_unit_checking"
|
814
|
+
},
|
815
|
+
{
|
816
|
+
"include": "#property_values"
|
817
|
+
},
|
818
|
+
{
|
819
|
+
"include": "#variables"
|
820
|
+
},
|
821
|
+
{
|
822
|
+
"include": "source.css#numeric-values"
|
823
|
+
},
|
824
|
+
{
|
825
|
+
"include": "#booleans"
|
826
|
+
},
|
827
|
+
{
|
828
|
+
"include": "#strings"
|
829
|
+
},
|
830
|
+
{
|
831
|
+
"include": "#operators"
|
832
|
+
}
|
833
|
+
]
|
542
834
|
}
|
543
835
|
}
|
544
836
|
}
|