Fixes issue with trailing ws
This commit is contained in:
parent
88649fce12
commit
7a93de35ad
|
@ -15,9 +15,11 @@ nap tap test
|
||||||
|
|
||||||
<> (?x pop-plain)
|
<> (?x pop-plain)
|
||||||
<> (?x pop) ()
|
<> (?x pop) ()
|
||||||
|
<> (ghost) ()
|
||||||
|
|
||||||
abc def pop-plain = abc test
|
abc def pop-plain = abc test
|
||||||
abc def pop = abc test
|
abc def pop = abc test
|
||||||
|
(ghost) = ()
|
||||||
|
|
||||||
?(?-) (Basic replacements)
|
?(?-) (Basic replacements)
|
||||||
|
|
||||||
|
|
4
makefile
4
makefile
|
@ -1,7 +1,7 @@
|
||||||
RELEASE_flags=-DNDEBUG -O2 -g0 -s
|
RELEASE_flags=-DNDEBUG -O2 -g0 -s
|
||||||
DEBUG_flags=-std=c89 -D_POSIX_C_SOURCE=199309L -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined
|
DEBUG_flags=-std=c89 -D_POSIX_C_SOURCE=199309L -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined
|
||||||
|
|
||||||
.PHONY: all debug dest run test install uninstall format clean archive
|
.PHONY: all debug dest run debug test install uninstall format clean archive
|
||||||
|
|
||||||
all: dest
|
all: dest
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@ dest:
|
||||||
@ mkdir -p bin
|
@ mkdir -p bin
|
||||||
run: all bin/modal
|
run: all bin/modal
|
||||||
@ bin/modal examples/hello.modal 2> /dev/null
|
@ bin/modal examples/hello.modal 2> /dev/null
|
||||||
|
debug: bin/modal-debug
|
||||||
|
@ bin/modal-debug examples/hello.modal
|
||||||
test: bin/modal-debug bin/modal
|
test: bin/modal-debug bin/modal
|
||||||
@ bin/modal -v
|
@ bin/modal -v
|
||||||
@ bin/modal-debug examples/tests.modal
|
@ bin/modal-debug examples/tests.modal
|
||||||
|
|
|
@ -147,8 +147,8 @@ write_rule(Rule *r, char last, char *res)
|
||||||
else
|
else
|
||||||
*dst_++ = c, last = c;
|
*dst_++ = c, last = c;
|
||||||
if(dst_ == origin) {
|
if(dst_ == origin) {
|
||||||
if(*res == ')') dst_--;
|
|
||||||
while(*res == ' ') res++;
|
while(*res == ' ') res++;
|
||||||
|
if(*res == ')' && *(dst_ - 1) == ' ') dst_--;
|
||||||
}
|
}
|
||||||
return commit_rule(r, res, 0);
|
return commit_rule(r, res, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue