-
Notifications
You must be signed in to change notification settings - Fork 16
/
Autoconf.YAML-tmLanguage
876 lines (858 loc) · 28.7 KB
/
Autoconf.YAML-tmLanguage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
# [PackageDev] target_format: plist, ext: tmLanguage
# Adapted from:
# https://git.gnome.org/browse/gtksourceview/tree/data/language-specs/m4.lang
---
uuid: cd50bfc0-2ccb-47b9-a157-98b00816d909
name: Autoconf M4
scopeName: source.m4
fileTypes:
- configure.ac
- configure.in
- m4
- at
repository:
# M4 basic syntax
# ---------------
m4-quoted:
# 'm4-quoted' matches text between quote brackets and highlights it as pure
# M4 (no shell code allowed).
begin: \[
end: \]
patterns:
- include: '#m4-pure'
m4-quoted-shell:
# 'm4-quoted-shell'' matches text between quote brackets and highlights it
# as a mix of M4 and shell code.
begin: \[
end: \]
patterns:
- include: $self
m4-function-call:
# This context matches text between parentheses that comes after a word, and
# treats it as a variable-length list of 'm' arguments. This is necessary
# for unknown or user-defined macros - without this context, their arguments
# would all be highlighted as shell code.
begin: (?<=[\w\d_])\((?!\))
end: \)
patterns:
- include: '#ARG-M'
- begin: ','
end: (?=\))
patterns:
- include: '#ARG-M'
m4-comment:
# M4 'dnl' comments are removed from the output, as opposed to shell '#'
# comments, which appear in the output.
name: comment.line.dnl.m4
begin: dnl
end: $
patterns: []
quadrigraph:
# @<:@ and @:>@ to replace left and right brackets
name: constant.character.escape.quadrigraph.m4
match: '@(<:|:>)@'
patterns: []
# M4 macros state machine
# -----------------------
# In the following section, the contexts form a pretty straightforward state
# machine that consumes each macro argument and moves on to the next state.
NO-ARGS:
# This state means all the expected arguments have been consumed, and so any
# remaining arguments are errors.
name: invalid.illegal.supernumerary-argument.m4
begin: ','
end: (?=\))
patterns: []
ARG-M:
# This is an argument containing only pure M4.
patterns:
- include: '#m4-pure'
ARG-S:
# This is an argument containing a mix of M4 and shell code.
patterns:
- include: '#m4-quoted-shell'
- include: '#m4-pure'
# The TO-ARGS- states match a comma, and then enter the corresponding ARGS-
# state
TO-ARGS-M:
<<: &TO-ARGS
begin: ','
end: (?=\))
patterns:
- include: '#ARGS-M'
TO-ARGS-S:
<<: *TO-ARGS
patterns:
- include: '#ARGS-S'
TO-ARGS-MM:
<<: *TO-ARGS
patterns:
- include: '#ARGS-MM'
TO-ARGS-MS:
<<: *TO-ARGS
patterns:
- include: '#ARGS-MS'
TO-ARGS-SM:
<<: *TO-ARGS
patterns:
- include: '#ARGS-SM'
TO-ARGS-SS:
<<: *TO-ARGS
patterns:
- include: '#ARGS-SS'
TO-ARGS-MMM:
<<: *TO-ARGS
patterns:
- include: '#ARGS-MMM'
TO-ARGS-MMS:
<<: *TO-ARGS
patterns:
- include: '#ARGS-MMS'
TO-ARGS-MSS:
<<: *TO-ARGS
patterns:
- include: '#ARGS-MSS'
TO-ARGS-SSM:
<<: *TO-ARGS
patterns:
- include: '#ARGS-SSM'
TO-ARGS-SSS:
<<: *TO-ARGS
patterns:
- include: '#ARGS-SSS'
TO-ARGS-MMMM:
<<: *TO-ARGS
patterns:
- include: '#ARGS-MMMM'
TO-ARGS-MMSS:
<<: *TO-ARGS
patterns:
- include: '#ARGS-MMSS'
TO-ARGS-MSSM:
<<: *TO-ARGS
patterns:
- include: '#ARGS-MSSM'
TO-ARGS-MSSS:
<<: *TO-ARGS
patterns:
- include: '#ARGS-MSSS'
TO-ARGS-MMMMM:
<<: *TO-ARGS
patterns:
- include: '#ARGS-MMMMM'
TO-ARGS-MMMSS:
<<: *TO-ARGS
patterns:
- include: '#ARGS-MMMSS'
TO-ARGS-MVARARGS:
<<: *TO-ARGS
patterns:
- include: '#ARGS-MVARARGS'
TO-ARGS-SVARARGS:
<<: *TO-ARGS
patterns:
- include: '#ARGS-SVARARGS'
# The ARGS- states match an argument of the type of the head of the argument
# list, and then enter the TO-ARGS- state corresponding to the tail of the
# argument list. (Or CAR and CDR, if you prefer.)
ARGS-M:
patterns:
- include: '#ARG-M'
- include: '#NO-ARGS'
ARGS-S:
patterns:
- include: '#ARG-S'
- include: '#NO-ARGS'
ARGS-MM:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-M'
ARGS-MS:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-S'
ARGS-SM:
patterns:
- include: '#ARG-S'
- include: '#TO-ARGS-M'
ARGS-SS:
patterns:
- include: '#ARG-S'
- include: '#TO-ARGS-S'
ARGS-MMM:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-MM'
ARGS-MMS:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-MS'
ARGS-MSM:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-SM'
ARGS-MSS:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-SS'
ARGS-SSM:
patterns:
- include: '#ARG-S'
- include: '#TO-ARGS-SM'
ARGS-SSS:
patterns:
- include: '#ARG-S'
- include: '#TO-ARGS-SS'
ARGS-MMMM:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-MMM'
ARGS-MMMS:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-MMS'
ARGS-MMSS:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-MSS'
ARGS-MSSM:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-SSM'
ARGS-MSSS:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-SSS'
ARGS-SSSS:
patterns:
- include: '#ARG-S'
- include: '#TO-ARGS-SSS'
ARGS-MMMMM:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-MMMM'
ARGS-MMMSS:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-MMSS'
ARGS-MMSSM:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-MSSM'
ARGS-MMSSS:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-MSSS'
ARGS-MMMMMM:
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-MMMMM'
ARGS-SMMMSS:
patterns:
- include: '#ARG-S'
- include: '#TO-ARGS-MMMSS'
ARGS-MVARARGS:
# The ARGS-?VARARGS states go to their own TO-ARGS- states, of course
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-MVARARGS'
ARGS-SVARARGS:
patterns:
- include: '#ARG-S'
- include: '#TO-ARGS-SVARARGS'
ARGS-AS-CASE:
# AS_CASE is the odd one out. Its signature should actually be M(MS)+S?,
# i.e. an M followed by one or more pairs of MS, ending with an optional S,
# but there's no way to highlight that properly without knowing whether a
# given argument is the last one. Therefore, we highlight it as M plus
# SVARARGS.
patterns:
- include: '#ARG-M'
- include: '#TO-ARGS-SVARARGS'
# Macro lists
# -----------
# The func- contexts are the ones actually included in the 'm4-pure' context
# below. They match the macro names, and the opening and closing parentheses.
func-m:
begin: "\\b(AC_(?:CHECK_(?:DECL|FUNC|HEADER)S_ONCE|CHECKING|\
CONFIG_(?:(?:(?:AUX|LIBOBJ)_|SRC)DIR|MACRO_DIRS?|SUBDIRS)|COPYRIGHT|\
ERLANG_NEED_ERLC?|F(?:77|C)_LIBRARY_LDFLAGS|FATAL|INCLUDES_DEFAULT|\
LANG(?:_(?:ASSERT|CONFTEST|FUNC_LINK_TRY|POP|PUSH|SOURCE))?|\
LIB(?:OBJS|SOURCES?)|MSG_(?:CHECKING|NOTICE|RESULT|WARN)|OPENMP|\
PREFIX_(?:DEFAULT|PROGRAM)|PREREQ|PROG_(?:CC|CXX|F77|OBJC(?:XX)?)|\
REPLACE_FUNCS|REQUIRE(?:_AUX_FILE)?|REVISION|SUBST_FILE|WARNING)|\
AH_(?:BOTTOM|TOP)|\
AS_(?:DIRNAME|(?:EXECUTABLE|MKDIR)_P|EXIT|SET_STATUS|TR_(?:CPP|SH)|\
VAR_(?:POPDEF|TEST_SET))|\
m4_(?:chomp(?:_all)?|cleardivert|debug(?:file|mode)|decr|defn|\
divert(?:_(?:pop|push))?|errprintn|(?:re_)?escape|exit|expand|flatten|\
s?include|incr|len|(?:make|mks)temp|n|newline|normalize|\
pattern_(?:allow|forbid)|popdef|set_(?:delete|list|listc|size)|sign|\
strip|to(?:lower|upper)|warning|wrap(?:_lifo)?)|\
AT_(?:BANNER|CAPTURE_FILE|COPYRIGHT|INIT|KEYWORDS|SETUP|TESTED)|\
AM_(?:GNU_GETTEXT_(?:VERSION|NEED)|EXTRA_RECURSIVE_TARGETS|ICONV|\
INIT_AUTOMAKE|MAINTAINER_MODE|PROG_UPC|SUBST_NOTMAKE|XGETTEXT_OPTION)|\
LT_(?:INIT|LANG|PREREQ)|\
IT_PO_SUBDIR|\
GOBJECT_INTROSPECTION_(?:CHECK|REQUIRE)|\
PKG_PREREQ|PKG_(?:NOARCH_)?INSTALLDIR)\\s*(\\()"
<<: &func-common
end: \)
beginCaptures:
'1': {name: keyword.other.macro.m4}
'2': {name: keyword.operator.function-call.m4}
endCaptures:
'0': {name: keyword.operator.function-call.m4}
patterns:
- include: '#ARGS-M'
func-s:
begin: "\\b(AC_CONFIG_COMMANDS_(?:PRE|POST)|AS_(?:ECHO(?:_N)?|UNSET)|\
m4_(?:esyscmd(?:_s)?|syscmd)|\
AT_(?:X?FAIL|SKIP)_IF)\\s*(\\()"
<<: *func-common
patterns:
- include: '#ARGS-S'
func-mm:
begin: "\\b(AC_(?:ARG_VAR|BEFORE|CHECK_ALIGNOF|CONFIG_TESTDIR|DIAGNOSE|\
ERLANG_(?:PATH_ERLC?|SUBST_INSTALL_LIB_SUBDIR)|F(?:77|C)_FUNC|\
LANG_(?:CALL|PROGRAM)|MSG_(?:ERROR|FAILURE)|PROG_FC)|\
AH_(?:TEMPLATE|VERBATIM)|\
AU_ALIAS|\
AS_(?:BOX|ESCAPE|TMPDIR|VAR_(?:APPEND|COPY|PUSHDEF))|\
m4_(?:append_uniq_w|apply|assert|change(?:com|quote)|(?:list)?cmp|\
(?:copy|rename)(?:_force)?|default(?:_nblank)?(?:_quoted)?|\
define(?:_default)?|defun|divert_(?:once|text)|fatal|index|map(?:all)?|\
pushdef|set_(?:contents|difference|dump|intersection|map|union)|split|\
stack_foreach(?:_lifo)?|text_box|version_compare|warn)|\
AT_DATA|\
AM_MISSING_PROG|\
GTK_DOC_CHECK|\
IT_PROG_INTLTOOL)\\s*(\\()"
<<: *func-common
patterns:
- include: '#ARGS-MM'
func-ms:
begin: "\\b(AC_(?:CACHE_VAL|DEFUN(?:_ONCE)?|SUBST)|\
AS_(?:INIT_GENERATED|VAR_(?:ARITH|SET))|\
AM_CONDITIONAL)\\s*(\\()"
<<: *func-common
patterns:
- include: '#ARGS-MS'
func-ss:
begin: "\\b(AC_(?:F(?:77|C)_(?:DUMMY_MAIN|IMPLICIT_NONE)|\
FC_(?:CHECK_BOUNDS|(?:FREE|FIXED)FORM|\
MODULE_(?:OUTPUT_)?FLAG|PP_DEFINE)))\\s*(\\()"
<<: *func-common
patterns:
- include: '#ARGS-SS'
func-mmm:
begin: "\\b(AC_(?:CHECK_SIZEOF|DEFINE(?:_UNQUOTED)?)|\
AS_SET_CATFILE|\
m4_(?:append|bpatsubst|bregexp|eval|ifn?blank|ifn?def|ifset|ifvaln?|\
map(?:all)?_sep|set_(?:empty|foreach)|substr|translit|version-prereq)|\
AM_GNU_GETTEXT)\\s*(\\()"
<<: *func-common
patterns:
- include: '#ARGS-MMM'
func-mms:
begin: \b(AC_CACHE_CHECK|m4_foreach(?:_w)?)\s*(\()
<<: *func-common
patterns:
- include: '#ARGS-MMS'
func-msm:
begin: \b(AU_DEFUN)\s*(\()
<<: *func-common
patterns:
- include: '#ARGS-MSM'
func-mss:
begin: "\\b(AC_(?:CHECK_(?:FILE|FUNC)(?:S)?|\
(?:COMPILE|LINK|PREPROC)_IFELSE|CONFIG_(?:COMMANDS|FILES|HEADERS|LINKS)|\
ERLANG_CHECK_LIB|FC_(?:LINE_LENGTH|(?:PP_)?SRCEXT))|\
AS_VAR_SET_IF|\
AM_(?:COND_IF|PATH_PYTHON|PROG_VALAC)|\
PKG_CHECK_EXISTS)\\s*(\\()"
<<: *func-common
patterns:
- include: '#ARGS-MSS'
func-mmmm:
begin: "\\b(AC_(?:CHECK_(?:PROGS|(?:TARGET_)?TOOLS?)|\
PATH_(?:PROGS?|(?:TARGET_)?TOOL))|\
AS_HELP_STRING|\
m4_(?:map_args_w|set_(?:add|contains|map_sep|remove)|\
stack_foreach_sep(?:_lifo)?|text|wrap))\\s*(\\()"
<<: *func-common
patterns:
- include: '#ARGS-MMMM'
func-mmms:
begin: \b(AC_COMPUTE_INT)\s*(\()
<<: *func-common
patterns:
- include: '#ARGS-MMMS'
func-mmss:
begin: "\\b(AC_(?:ARG_(?:ENABLE|WITH)|EGREP_(?:CPP|HEADER))|\
AS_VAR_IF|\
AT_ARG_OPTION(?:_ARG)?|\
PKG_CHECK_MODULES(?:_STATIC)?)\\s*(\\()"
<<: *func-common
patterns:
- include: '#ARGS-MMSS'
func-mssm:
begin: \b(AC_CHECK_(?:DECL|HEADER|MEMBER|TYPE)(?:S)?)\s*(\()
<<: *func-common
patterns:
- include: '#ARGS-MSSM'
func-msss:
begin: \b(AC_RUN_IFELSE)\s*(\()
<<: *func-common
patterns:
- include: '#ARGS-MSSS'
func-ssss:
begin: \b(AC_C_BIGENDIAN|AS_LITERAL_(?:WORD_)?IF)\s*(\()
<<: *func-common
patterns:
- include: '#ARGS-SSSS'
func-mmmmm:
begin: \b(m4_(?:append_uniq|for)|AC_INIT)\s*(\()
<<: *func-common
patterns:
- include: '#ARGS-MMMMM'
func-mmmss:
begin: \b(AT_CHECK_EUNIT|PKG_CHECK_VAR)\s*(\()
<<: *func-common
patterns:
- include: '#ARGS-MMMSS'
func-mmssm:
begin: \b(AC_(?:CHECK_LIB|SEARCH_LIBS|PATH_PROGS_FEATURE_CHECK))\s*(\()
<<: *func-common
patterns:
- include: '#ARGS-MMSSM'
func-mmsss:
begin: \b(AS_VERSION_COMPARE)\s*(\()
<<: *func-common
patterns:
- include: '#ARGS-MMSSS'
func-mmmmmm:
begin: \b(AC_CHECK_PROG)\s*(\()
<<: *func-common
patterns:
- include: '#ARGS-MMMMMM'
func-smmmss:
begin: \b(AT_CHECK(?:_UNQUOTED)?)\s*(\()
<<: *func-common
patterns:
- include: '#ARGS-SMMMSS'
func-mvarargs:
begin: "\\b(m4_(?:argn|bmatch|bpatsubsts|car|case|cdr|builtin|combine|cond|\
count|curry|do|dquote(?:_elt)?|dumpdefs?|echo|errprint|format|if|ignore|\
indir|join(?:all)?|makelist|map_args(?:_(?:pair|sep))?|max|min|\
(?:un)?quote|reverse|set_add_all|shift(?:2|3|n)?|trace(?:off|on)|\
undefine|undivert))\\s*(\\()"
<<: *func-common
patterns:
- include: '#ARGS-MVARARGS'
func-svarargs:
begin: \b(AS_IF)\s*(\()
<<: *func-common
patterns:
- include: '#ARGS-SVARARGS'
func-as-case:
begin: \b(AS_CASE)\s*(\()
end: \)
beginCaptures:
'1':
name: keyword.other.macro.m4sh
'2':
name: keyword.operator.function-call.m4
endCaptures:
'0':
name: keyword.operator.function-call.m4
patterns:
- include: '#ARGS-AS-CASE'
# Now come the macros that don't take any arguments. They are not called
# with empty parentheses, just with the macro name: e.g. AC_OUTPUT.
#
# We also have contexts for macros that do take arguments, but can also be
# called without any; for example, AC_PROG_CC takes a list of compiler names
# to search for, but is mostly just called without it. Since the 'func-m'
# context would only match AC_PROG_CC(), we repeat this kind of macros in
# '-optargs' contexts.
m4-macros-noargs:
name: keyword.other.macro.m4
match: \bm4_(divnum|init|location|sysval)
patterns: []
m4-macros-optargs:
name: keyword.other.macro.m4
match: "\\bm4_(change(com|quote)|debug(file|mode)|divert_pop|newline|\
trace(on|off))"
patterns: []
ac-macros-noargs:
name: keyword.other.macro.autoconf
match: "\\bAC_(ARG_PROGRAM|AUTOCONF_VERSION|C_BACKSLASH_A|\
CACHE_(LOAD|SAVE)|CANONICAL_(BUILD|HOST|TARGET)|CHECK_HEADER_STDBOOL|\
C_(CHAR_UNSIGNED|CONST|FLEXIBLE_ARRAY_MEMBER|INLINE|PROTOTYPES|RESTRICT|\
STRINGIZE|TYPEOF|VARARRAYS|VOLATILE)|DISABLE_OPTION_CHECKING|\
ERLANG_SUBST_(((INSTALL_)?LIB|ROOT)_DIR|ERTS_VER)|F77_(MAIN|WRAPPERS)|\
FC_(MAIN|MODULE_EXTENSION|WRAPPERS)|FUNC_(ALLOCA|CHOWN|CLOSEDIR_VOID|\
FNMATCH(_GNU)?|FORK|FSEEKO|GETGROUPS|GETLOADAVG|GETMNTENT|GETPGRP|LSTAT|\
MALLOC|MBRTOWC|MEMCMP|MMAP|OBSTACK|REALLOC|SELECT_ARGTYPES|SETPGRP|STAT|\
STRCOLL|STRERROR_R|STRFTIME|STRNLEN|STRTOLD|UTIME_NULL|VPRINTF)|\
HEADER_(ASSERT|DIRENT|MAJOR|RESOLV|STAT|STDBOOL|STDC|SYS_WAIT|TIME|\
TIOCGWINSZ)|LANG_(DEFINES_PROVIDED|WERROR)|OUTPUT|\
PACKAGE_(BUGREPORT|NAME|STRING|TARNAME|URL|VERSION)|PATH_X(TRA)?|\
PRESERVE_HELP_ORDER|PROG_(AWK|CC(_C(89|99|_O))|CC_STDC|CPP(_WERROR)?|\
CXX(CPP|_C_O)?|EGREP|F77_C_O|FC_C_O|FGREP|GCC_TRADITIONAL|GREP|INSTALL|\
LEX|LN_S|MAKE_SET|MKDIR_P|OBJ(CXX)?CPP|RANLIB|SED|YACC)|REPLACE_FNMATCH|\
REQUIRE_CPP|STRUCT_(DIRENT_D_(INO|TYPE)|ST_BLOCKS|TIMEZONE|TM)|\
SYS_(INTERPRETER|LARGEFILE|LONG_FILE_NAMES|POSIX_TERMIOS)|\
TYPE_(GETGROUPS|INT(16_T|32_T|64_T|8_T)|INTMAX_T|INTPTR_T|\
LONG_DOUBLE(_WIDER)?|LONG_LONG_INT|MBSTATE_T|MODE_T|OFF_T|PID_T|SIGNAL|\
SIZE_T|SSIZE_T|UID_T|UINT(16_T|32_T|64_T|8_T)|UINTMAX_T|UINTPTR_T|\
UNSIGNED_LONG_LONG_INT)|USE_SYSTEM_EXTENSIONS)"
patterns: []
ac-macros-noargs2:
name: keyword.other.macro.autoconf
match: "\\bA(H_HEADER|S_(BOURNE_COMPATIBLE|INIT|LINENO_PREPARE|ME_PREPARE|\
MESSAGE_FD|MESSAGE_LOG_FD|ORIGINAL_STDIN_FD|SHELL_SANITIZE)|\
T_(CLEANUP|COLOR_TESTS))"
patterns: []
ac-macros-optargs:
name: keyword.other.macro.autoconf
match: "\\bAC_(C_BIGENDIAN|ERLANG_(PATH|NEED)_ERLC?|F(77|C)_DUMMY_MAIN|\
FC_((FIXED|FREE)FORM|LINE_LENGTH)|INCLUDES_DEFAULT|LANG_POP|\
PROG_(CC|CXX|OBJC(XX)?|F(77|C)))"
patterns: []
ac-macros-optargs2:
name: keyword.other.macro.autoconf
match: \bA(S_EXIT|T_INIT)
patterns: []
ac-macros-obsolete:
# Deprecated macros are highlighted as errors. We don't bother highlighting
# their arguments properly, because they're deprecated anyway!
name: invalid.deprecated.macro.autoconf
match: "\\bAC_(AIX|ALLOCA|ARG_ARRAY|CANONICAL_SYSTEM|C_(CROSS|LONG_DOUBLE)|\
CHAR_UNSIGNED|CHECKING|COMPILE_CHECK|CONFIG_HEADER|CONST|CROSS_CHECK|\
CYGWIN|DECL_(SYS_SIGLIST|YYTEXT)|DIR_HEADER|\
DISABLE_(FAST_INSTALL|SHARED|STATIC)|DYNIX_SEQ|ENABLE(_(SHARED|STATIC))?|\
EMXOS2|ERROR|EXEEXT|FIND_X(TRA)?|FOREACH|FUNC_(CHECK|ERROR_AT_LINE|\
LSTAT_FOLLOWS_SLASHED_SYMLINK|MKTIME|SETVBUF_REVERSED|STRTOD|WAIT3)|\
GCC_TRADITIONAL|GETGROUPS_T|GETLOADAVG|GNU_SOURCE|\
HAVE_(FUNCS|HEADERS|LIBRARY|POUNDBANG)|HEADER_(CHECK|EGREP)|HELP_STRING|\
INLINE|INT_16_BITS|IRIX_SUN|LANG_(CPLUSPLUS|C|FORTRAN77|RESTORE|SAVE)|\
LIBTOOL_(DLOPEN|WIN32_DLL)|LINK_FILES|LN_S|\
LONG_(64_BITS|DOUBLE|FILE_NAMES)|MAJOR_HEADER|MEMORY_H|MINGW32|MINIX|\
MINUS_C_MINUS_O|MMAP|MODE_T|OBJEXT|OBSOLETE|OFF_T|OUTPUT_COMMANDS|PID_T|\
PREFIX|PROG_(INTL|LIB)TOOL|PROGRAM_(CHECK|EGREP|PATH)|\
PROGRAMS_(CHECK|PATH)|REMOTE_TAPE|RESTARTABLE_SYSCALLS|RETSIGTYPE|RSH|\
SCO_INTL|SET_MAKE|SETVBUF_REVERSED|SIZEOF_TYPE|SIZE_T|STAT_MACROS_BROKEN|\
ST_(BLKSIZE|BLOCKS|RDEV)|STDC_HEADERS|STRCOLL|\
SYS_(RESTARTABLE_SYSCALLS|SIGLIST_DECLARED)|TEST_(CPP|PROGRAM)|\
TIME_WITH_SYS_TIME|TIMEZONE|TRY_(COMPILE|CPP|LINK_FUNC|LINK|RUN)|UID_T|\
UNISTD_H|USG|UTIME_NULL|VALIDATE_CACHED_SYSTEM_TUPLE|VERBOSE|VFORK|\
VPRINTF|WAIT3|WARN|WITH|WORDS_BIGENDIAN|XENIX_DIR|YYTEXT_POINTER)"
patterns: []
am-macros-noargs:
name: keyword.other.macro.automake
match: "\\bAM_(ENABLE_MULTILIB|GCONF_SOURCE_2|GLIB_GNU_GETTEXT|\
GNU_GETTEXT_INTL_SUBDIR|PATH_LISPDIR|PO_SUBDIRS|PROG_(AR|AS|GCJ|LEX)|\
SILENT_RULES|WITH_DMALLOC)"
patterns: []
am-macros-optargs:
name: keyword.other.macro.automake
match: \bAM_(INIT_AUTOMAKE|MAINTAINER_MODE|PATH_PYTHON|PROG_(UPC|VALAC))
patterns: []
am-macros-private:
name: invalid.illegal.private.automake
match: "\\bAM_(DEP_TRACK|MAKE_INCLUDE|OUTPUT_DEPENDENCY_COMMANDS|\
PROG_INSTALL_STRIP|SANITY_CHECK|SET_DEPDIR)"
patterns: []
am-macros-obsolete:
name: invalid.deprecated.macro.automake
match: "\\bAM_(C_PROTOTYPES|CONFIG_HEADER|\
HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL|PATH_CHECK|\
PROG_(CC_(STDC|C_O)|LIBTOOL|MKDIR_P)|SYS_POSIX_TERMIOS|WITH_REGEX|\
(DIS|EN)ABLE_(STATIC|SHARED))"
patterns: []
misc-macros-noargs:
name: keyword.other.macro.autotools
match: "\\b(__(file|o?line)__|LT_(CMD_MAX_LEN|FUNC_DLSYM_USCORE|\
LIB_(M|DLLOAD)|OUTPUT|PATH_(LD|NM)|SYS_(DLOPEN_(SELF|DEPLIBS)|\
MODULE_(EXT|PATH)|DLSEARCH_PATH|SYMBOL_USCORE)))"
patterns: []
misc-macros-optargs:
name: keyword.other.macro.autotools
match: \b(LT_INIT|PKG_PROG_PKG_CONFIG)
patterns: []
m4-pure:
# This context highlights pure M4 code.
patterns:
- include: '#m4-comment'
- include: '#quadrigraph'
- include: '#func-m'
- include: '#func-s'
- include: '#func-mm'
- include: '#func-ms'
- include: '#func-ss'
- include: '#func-mmm'
- include: '#func-mms'
- include: '#func-msm'
- include: '#func-mss'
- include: '#func-mmmm'
- include: '#func-mmms'
- include: '#func-mmss'
- include: '#func-mssm'
- include: '#func-msss'
- include: '#func-ssss'
- include: '#func-mmmmm'
- include: '#func-mmmss'
- include: '#func-mmssm'
- include: '#func-mmsss'
- include: '#func-mmmmmm'
- include: '#func-smmmss'
- include: '#func-mvarargs'
- include: '#func-svarargs'
- include: '#func-as-case'
- include: '#m4-macros-noargs'
- include: '#m4-macros-optargs'
- include: '#ac-macros-noargs'
- include: '#ac-macros-noargs2'
- include: '#ac-macros-optargs'
- include: '#ac-macros-optargs2'
- include: '#ac-macros-obsolete'
- include: '#am-macros-noargs'
- include: '#am-macros-optargs'
- include: '#am-macros-obsolete'
- include: '#am-macros-private'
- include: '#misc-macros-noargs'
- include: '#misc-macros-optargs'
- include: '#m4-function-call'
- include: '#m4-quoted'
- name: invalid.illegal.syntax-error
match: \]
# Adaptations of built-in shell syntax definitions
# ------------------------------------------------
shell-interpolation:
# This is a copy of some of the patterns from the #interpolation pattern
# from source.shell so that anywhere shell includes $self, M4 code is also
# legal.
patterns:
- name: string.interpolated.backtick.shell
begin: '`'
end: '`'
beginCaptures:
'0': {name: punctuation.definition.string.begin.shell}
endCaptures:
'0': {name: punctuation.definition.string.end.shell}
patterns:
- name: constant.character.escape.shell
match: \\[`\\$]
- include: $self
- name: string.interpolated.dollar.shell
begin: \$\(
end: \)
beginCaptures:
'0': {name: punctuation.definition.string.begin.shell}
endCaptures:
'0': {name: punctuation.definition.string.end.shell}
patterns:
- include: $self
shell-compound-command:
# This is a copy of some of the patterns from #compound-command from
# source.shell, so that anywhere shell includes $self, M4 code is also
# legal.
patterns:
- name: meta.scope.logical-expression.shell
begin: (\[{2})
end: (\]{2})
captures:
'1': {name: punctuation.definition.logical-expression.shell}
patterns:
- include: source.shell.logical-expression
- include: $self
- name: meta.scope.subshell.shell
begin: (\()
end: (\))
captures:
'1': {name: punctuation.definition.subshell.shell}
patterns:
- include: $self
- name: meta.scope.group.shell
begin: (?<=\s|^)(\{)(?=\s|$)
end: (?<=^|;)\s*(\})
captures:
'1': {name: punctuation.definition.group.shell}
patterns:
- include: $self
shell-pathname:
# This is a copy of one of the patterns from #pathname from source.shell, so
# that anywhere shell includes $self, M4 code is also legal.
patterns:
- name: meta.structure.extglob.shell
begin: ([?*+@!])(\()
end: (\))
beginCaptures:
'1': {name: keyword.operator.extglob.shell}
'2': {name: punctuation.definition.extglob.shell}
endCaptures:
'1': {name: punctuation.definition.extglob.shell}
patterns:
- include: $self
shell-string:
# This is a copy of #string from source.shell so that we can include our
# doctored #shell-interpolation before source.shell.interpolation.
patterns:
- name: string.quoted.double.shell
begin: \$?"
end: '"'
beginCaptures:
'0': {name: punctuation.definition.string.begin.shell}
endCaptures:
'0': {name: punctuation.definition.string.end.shell}
patterns:
- name: constant.character.escape.shell
match: \\[\$`"\\\n]
- include: source.shell.variable
- include: '#shell-interpolation'
- include: source.shell.interpolation
shell-loop:
# This is a copy of the #loop pattern from source.shell so that anywhere
# shell includes $self, M4 code is also legal.
patterns:
- name: meta.scope.for-loop.shell
begin: \b(for)\s+(?=\({2})
end: \b(done)\b
captures:
'1': {name: keyword.control.shell}
patterns:
- include: $self
- name: meta.scope.for-in-loop.shell
begin: \b(for)\s+((?:[^\s\\]|\\.)+)\b
end: \b(done)\b
beginCaptures:
'1': {name: keyword.control.shell}
'2': {name: variable.other.loop.shell}
endCaptures:
'1': {name: keyword.control.shell}
patterns:
- include: $self
- name: meta.scope.while-loop.shell
begin: \b(while|until)\b
end: \b(done)\b
captures:
'1': {name: keyword.control.shell}
patterns:
- include: $self
- name: meta.scope.select-block.shell
begin: \b(select)\s+((?:[^\s\\]|\\.)+)\b
end: \b(done)\b
beginCaptures:
'1': {name: keyword.control.shell}
'2': {name: variable.other.loop.shell}
endCaptures:
'1': {name: keyword.control.shell}
patterns:
- include: $self
- name: meta.scope.case-block.shell
begin: \b(case)\b
end: \b(esac)\b
captures:
'1': {name: keyword.control.shell}
patterns:
- name: meta.scope.case-body.shell
begin: \b(?:in)\b
end: (?=\b(?:esac)\b)
beginCaptures:
'1': {name: keyword.control.shell}
patterns:
- include: source.shell.comment
- include: '#shell-case-clause'
- include: source.shell.case-clause
- include: $self
- include: $self
- name: meta.scope.if-block.shell
begin: \b(if)\b
end: \b(fi)\b
captures:
'1': {name: keyword.control.shell}
patterns:
- include: $self
shell-function-definition:
# This is a copy of the #function-definition pattern from source.shell so
# that anywhere shell includes $self, M4 code is also legal.
patterns:
- name: meta.function.shell
begin: \b(function)\s+([^\s\\]+)(?:\s*(\(\)))?
end: ;|&|$
beginCaptures:
'1': {name: storage.type.function.shell}
'2': {name: entity.name.function.shell}
'3': {name: punctuation.definition.arguments.shell}
endCaptures:
'0': {name: punctuation.definition.function.shell}
patterns:
- include: $self
- name: meta.function.shell
begin: \b([^\s\\=]+)\s*(\(\))
end: ;|&|$
beginCaptures:
'1': {name: entity.name.function.shell}
'2': {name: punctuation.definition.arguments.shell}
endCaptures:
'0': {name: punctuation.definition.function.shell}
patterns:
- include: $self
shell-case-clause:
# This is a copy of the #case-clause pattern from source.shell so that
# anywhere shell includes $self, M4 code is also legal.'
patterns:
- name: meta.scope.case-clause.shell
begin: (?=\S)
end: ;;
endCaptures:
'0': {name: punctuation.terminator.case-clause.shell}
patterns:
- name: meta.scope.case-pattern.shell
begin: (\(|(?=\S))
captures:
'0': {name: punctuation.definition.case-pattern.shell}
end: \)
patterns:
- name: punctuation.separator.pipe-sign.shell
match: \|
- include: '#shell-string'
- include: source.shell.string
- include: source.shell.variable
- include: '#shell-interpolation'
- include: source.shell.interpolation
- include: '#shell-pathname'
- include: source.shell.pathname
- name: meta.scope.case-clause-body.shell
begin: (?<=\))
end: (?=;;)
patterns:
- include: $self
shell-redirection:
# This is a copy of one of the patterns from the #redirection pattern from
# source.shell so that anywhere shell includes $self, M4 code is also legal.
patterns:
- name: string.interpolated.process-substitution.shell
begin: '[><]\('
end: \)
beginCaptures:
'0': {name: punctuation.definition.string.begin.shell}
endCaptures:
'0': {name: punctuation.definition.string.end.shell}
patterns:
- include: $self
patterns:
- include: '#m4-quoted-shell'
- include: '#m4-pure'
- include: '#shell-interpolation'
- include: '#shell-compound-command'
- include: '#shell-pathname'
- include: '#shell-string'
- include: '#shell-loop'
- include: '#shell-function-definition'
- include: '#shell-redirection'
- include: source.shell
- name: invalid.illegal.syntax-error
match: \)