src.elv.sh@v0.21.0-dev.0.20240515223629-06979efb9a2a/vscode/syntaxes/elvish.tmLanguage.json (about)

     1  {
     2  	"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
     3  	"name": "Elvish",
     4  	"scopeName": "source.elvish",
     5  	"fileTypes": [
     6  		"elv"
     7  	],
     8  	"patterns": [
     9  		{
    10  			"name": "string.quoted.double.elvish",
    11  			"begin": "\"",
    12  			"end": "\"",
    13  			"patterns": [
    14  				{
    15  					"name": "constant.character.escape.elvish",
    16  					"match": "\\\\."
    17  				}
    18  			]
    19  		},
    20  		{
    21  			"name": "string.quoted.single.elvish",
    22  			"begin": "'",
    23  			"end": "'"
    24  		},
    25  
    26  		{
    27  			"name": "comment.line.number-sign.elvish",
    28  			"begin": "#",
    29  			"end": "$"
    30  		},
    31  
    32  		{
    33  			"name": "variable.other.elvish",
    34  			"match": "\\$[\\w\\d_:~-]+"
    35  		},
    36  		{
    37  			"match": "(?<=\\G|^|\\{ |\\{\t|\\(|\\||\\;)\\s*(var|set|tmp|del)((\\s+[\\w\\d_:~-]+)+)",
    38  			"captures": {
    39  				"1": {
    40  					"name": "keyword.other.elvish"
    41  				},
    42  				"2": {
    43  					"name": "variable.other.elvish"
    44  				}
    45  			}
    46  		},
    47  		{
    48  			"match": "(?<=\\G|^|\\{ |\\{\t|\\(|\\||\\;)\\s*(for)\\s+([\\w\\d_:~-]+)",
    49  			"captures": {
    50  				"1": {
    51  					"name": "keyword.control.elvish"
    52  				},
    53  				"2": {
    54  					"name": "variable.other.elvish"
    55  				}
    56  			}
    57  		},
    58  		{
    59  			"match": "(?<=})\\s+(catch|except)\\s+([\\w\\d_:~-]+)",
    60  			"captures": {
    61  				"1": {
    62  					"name": "keyword.control.elvish"
    63  				},
    64  				"2": {
    65  					"name": "variable.other.elvish"
    66  				}
    67  			}
    68  		},
    69  
    70  		{
    71  			"match": "(?<=\\G|^|\\{ |\\{\t|\\(|\\||\\;)\\s*(nop|!=|!=s|%|\\*|\\+|-gc|-ifaddrs|-log|-override-wcwidth|-stack|-|/|<|<=|<=s|<s|==|==s|>|>=|>=s|>s|all|assoc|base|bool|break|call|cd|compare|constantly|continue|count|defer|deprecate|dissoc|drop|each|eawk|echo|eq|eval|exact-num|exec|exit|external|fail|fg|float64|from-json|from-lines|from-terminated|get-env|has-env|has-external|has-key|has-value|is|keys|kind-of|make-map|multi-error|nop|not-eq|not|ns|num|one|only-bytes|only-values|order|peach|pprint|print|printf|put|rand|randint|range|read-line|read-upto|repeat|repr|resolve|return|run-parallel|search-external|set-env|show|sleep|slurp|src|styled|styled-segment|take|tilde-abbr|time|to-json|to-lines|to-string|to-terminated|unset-env|use-mod|wcswidth)(?=[\\s)}<>;|&])",
    72  			"captures": {
    73  				"1": {
    74  					"name": "support.function.elvish"
    75  				}
    76  			}
    77  		},
    78  
    79  		{
    80  			"match": "(?<=\\G|^|\\{ |\\{\t|\\(|\\||\\;)\\s*(and|or|coalesce)(?=[\\s)}<>;|&])",
    81  			"captures": {
    82  				"1": {
    83  					"name": "keyword.operator.elvish"
    84  				}
    85  			}
    86  		},
    87  		{
    88  			"match": "(?<=\\G|^|\\{ |\\{\t|\\(|\\||\\;)\\s*(use|var|set|tmp|del|pragma|fn)(?=[\\s)}<>;|&])",
    89  			"captures": {
    90  				"1": {
    91  					"name": "keyword.other.elvish"
    92  				}
    93  			}
    94  		},
    95  		{
    96  			"match": "(?<=\\G|^|\\{ |\\{\t|\\(|\\||\\;)\\s*(while|for|try|if)(?=[\\s)}<>;|&])",
    97  			"captures": {
    98  				"1": {
    99  					"name": "keyword.control.elvish"
   100  				}
   101  			}
   102  		},
   103  		{
   104  			"match": "(?<=})\\s+(elif|else|catch|except|finally)(?=[\\s)}<>;|&])",
   105  			"captures": {
   106  				"1": {
   107  					"name": "keyword.control.elvish"
   108  				}
   109  			}
   110  		},
   111  
   112  		{
   113  			"name": "keyword.operator.elvish",
   114  			"match": "[*?|&;<>()\\[\\]{}]"
   115  		}
   116  	]
   117  }