Do not match on substrings
This commit is contained in:
parent
7e9eab04fc
commit
2f9f9d7f15
|
@ -1,8 +1,8 @@
|
|||
?(?-) (This is a fully functional Modal REPL.)
|
||||
|
||||
<> quit EOF
|
||||
<> wait?~ (?~ wait!)
|
||||
<> (?: print) ?:
|
||||
<> (wait ?~) (?~ wait stdin)
|
||||
<> (EOF wait stdin) (Bye.\n print)
|
||||
<> (EOF wait!) (Bye.\n print)
|
||||
|
||||
(Say something, or type "quit":\n) print wait stdin
|
||||
(Say something, or type "quit":\n) print wait!
|
|
@ -52,6 +52,7 @@
|
|||
|
||||
connect foo bar baz = foo-barbaz (substring 1) test
|
||||
prefix-anything = anything-suffix (substring 2) test
|
||||
?(foo QQQ) foobar = foobar (substring 3) test
|
||||
|
||||
?(?-) (Lambdas)
|
||||
|
||||
|
|
2
makefile
2
makefile
|
@ -8,7 +8,7 @@ all: dest
|
|||
dest:
|
||||
@ mkdir -p bin
|
||||
run: all bin/modal
|
||||
@ bin/modal -q examples/hello.modal
|
||||
@ bin/modal examples/hello.modal
|
||||
debug: all bin/modal-debug
|
||||
@ bin/modal-debug examples/hello.modal
|
||||
test: all bin/modal-debug bin/modal
|
||||
|
|
|
@ -131,6 +131,8 @@ apply_rule(Rule *r, char *s)
|
|||
}
|
||||
if(c != *s++) return 0;
|
||||
}
|
||||
c = *s;
|
||||
if(!spacer(c)) return 0;
|
||||
/* phase: write rule */
|
||||
while((c = *b++)) {
|
||||
if(c == '?') {
|
||||
|
|
Loading…
Reference in New Issue