re-added escapable characters
This commit is contained in:
parent
6996441429
commit
cb29813cd2
11
src/linter.c
11
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();
|
||||
|
|
Loading…
Reference in New Issue