-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
m4sugar.scroll
73 lines (63 loc) · 2.21 KB
/
m4sugar.scroll
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
import ../code/conceptPage.scroll
id m4sugar
name M4Sugar
appeared 2003
tags pl
conceptDescription M4 by itself provides only a small, but sufficient, set of all-purpose macros. M4sugar introduces additional generic macros. Its name was coined by Lars J. Aas: “Readability And Greater Understanding Stands 4 M4sugar”
fileType text
centralPackageRepositoryCount 0
country United States
originCommunity Free Software Foundation, Inc.
reference http://www6.gnu.org/software/autoconf/manual/autoconf.pdf
linguistGrammarRepo https://github.com/Alhadis/language-etc
sampleCount 2
example
m4_define([m4_list_declare], [m4_do(
[m4_define([$1_GET], [m4_expand([m4_list_nth([$1], $][1)])])],
[m4_define([$1_FOREACH], [m4_foreach([item], [m4_dquote_elt(m4_list_contents([$1]))], m4_quote($][1))])],
)])
m4_define([m4_list_add], [m4_do(
[m4_pushdef([_LIST_NAME], [[_LIST_$1]])],
[m4_ifndef(_LIST_NAME,
[m4_define(_LIST_NAME, m4_dquote(m4_escape([$2])))],
[m4_define(_LIST_NAME, m4_dquote(m4_list_contents([$1]), m4_escape([$2])))],
)],
[m4_popdef([_LIST_NAME])],
)])
m4_define([m4_list_contents], [m4_do(
[m4_pushdef([_LIST_NAME], [[_LIST_$1]])],
[m4_ifndef(_LIST_NAME, [], m4_quote(_LIST_NAME))],
[m4_popdef([_LIST_NAME])],
)])
m4_define([m4_list_nth], [m4_argn([$2], m4_list_contents([$1]))])
m4_define([m4_list_pop_front], [m4_do(
[m4_pushdef([_LIST_NAME], [[_LIST_$1]])],
[m4_car(m4_unquote(_LIST_NAME))],
[m4_define(_LIST_NAME, m4_cdr(m4_unquote(_LIST_NAME)))],
[m4_popdef([_LIST_NAME])],
)])
m4_define([m4_list_pop_back], [m4_do(
[m4_pushdef([_LIST_NAME], [[_LIST_$1]])],
[m4_define(_LIST_NAME, m4_dquote(m4_reverse(m4_unquote(_LIST_NAME))))],
[m4_list_pop_front([$1])],
[m4_define(_LIST_NAME, m4_dquote(m4_reverse(m4_unquote(_LIST_NAME))))],
[m4_popdef([_LIST_NAME])],
)])
dnl
dnl $1: List name
dnl $2: What
dnl $3: If contains
dnl $4: If not
m4_define([m4_list_contains], [m4_do(
[m4_foreach([item], m4_list_contents([$1]), m4_if(item, [$2], [[$3]], [[$4]]))]
)])
githubLanguage M4Sugar
fileExtensions m4
trendingProjectsCount 0
type programming
group M4
filenames configure.ac
aceMode text
tmScope source.m4
aliases autoconf
repos 0