From cb29813cd27aa4c84cd16e8fafeb4aef7b55cfe6 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 16 May 2017 10:47:36 +0200 Subject: [PATCH] re-added escapable characters --- src/linter.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/linter.c b/src/linter.c index 1cbcfec..59e6f43 100644 --- a/src/linter.c +++ b/src/linter.c @@ -57,17 +57,22 @@ int main(int argc, char* argv[]){ addDot(&string); // q0 addDot(&string); // q1 addDot(&string); // q2 + addDot(&string); // q3 addStringTransition(&string, "\"\0"); // s0 + addStringTransition(&string, "\\\0"); // s1 addRangeTransition(&string, "az\0"); // r0 addRangeTransition(&string, "AZ\0"); // r1 addRangeTransition(&string, "09\0"); // r2 - addListTransition(&string, "-_\0"); // l0 + addListTransition(&string, "-_\0"); // l0 + addListTransition(&string, "rn\"\0"); // l1 linkDots(&string, 0, 1, STRING_T, 0); // q0 --s0--> q1 linkDots(&string, 1, 1, LIST_T, 0); // q0 --l0--> q1 linkDots(&string, 1, 1, RANGE_T, 0); // q0 --r0--> q1 linkDots(&string, 1, 1, RANGE_T, 1); // q0 --r1--> q1 linkDots(&string, 1, 1, RANGE_T, 2); // q0 --r2--> q1 - linkDots(&string, 1, 2, STRING_T, 0); // q1 --s0--> q2 + linkDots(&string, 1, 2, STRING_T, 1); // q1 --s1--> q2 + linkDots(&string, 2, 1, LIST_T, 1); // q2 --l1--> q1 + linkDots(&string, 1, 3, STRING_T, 0); // q1 --s0--> q3 struct Automate value = createAutomate("value"); @@ -100,7 +105,7 @@ int main(int argc, char* argv[]){ linkDots(&array, 1, 3, STRING_T, 1); // q1 --s1--> q3 char str[40] = {0}; - strcpy(str, "[null, \"abc\", \"def\", false, true, 12, -1.2, .54, -.3, 5.]\0"); + strcpy(str, "[null, \"abc\", \"def\", false, true, 12, -1.2, .54, -.3, 5., \"bla\\\"blo\\rbla\\n\"]\0"); clock_t start, stop; unsigned int browsed = 0; start = clock(); browsed = browse(&array, str, 0); stop = clock();