Skip to content

Commit b29e179

Browse files
ircmaxelldriusan
authored andcommitted
Make macros syntax error instead of silently failing. Thanks @marcioAlmada via #61:
1 parent 27fec29 commit b29e179

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/macros.yay

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
$(macro) {
44
declare {
5+
$! // syntax error if no match
56
$(repeat(either(
67
chain(
78
optional(buffer('static') as static),
@@ -112,7 +113,7 @@ $(macro) {
112113

113114
$(macro) {
114115
compile {
115-
function $(llvmidentifier() as name) ($(optional(ls(
116+
function $(llvmidentifier() as name) $! ($(optional(ls(
116117
T_VARIABLE as param,
117118
token(',')
118119
)) as params)) {
@@ -134,6 +135,7 @@ $(macro) {
134135

135136
$(macro :unsafe :recursive) {
136137
$(optional(buffer('unsigned')) as unsigned) compile {
138+
$!
137139
$(repeat(either(
138140
chain(T_VARIABLE as result, token('='), either(
139141
chain(T_VARIABLE as nullcheck_var, token(T_IS_EQUAL), buffer('null')) as nullcheck,

0 commit comments

Comments
 (0)