Codebase list libcypher-parser / a869e67
Merge tag 'dist/0.5.1' into debian Upstream version 0.5.1 Chris Leishman 7 years ago
11 changed file(s) with 451 addition(s) and 164 deletion(s). Raw diff Collapse all Expand all
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for libcypher-parser 0.5.0.
2 # Generated by GNU Autoconf 2.69 for libcypher-parser 0.5.1.
33 #
44 #
55 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
586586 # Identity of this package.
587587 PACKAGE_NAME='libcypher-parser'
588588 PACKAGE_TARNAME='libcypher-parser'
589 PACKAGE_VERSION='0.5.0'
590 PACKAGE_STRING='libcypher-parser 0.5.0'
589 PACKAGE_VERSION='0.5.1'
590 PACKAGE_STRING='libcypher-parser 0.5.1'
591591 PACKAGE_BUGREPORT=''
592592 PACKAGE_URL=''
593593
13981398 # Omit some internal or obsolete options to make the list less imposing.
13991399 # This message is too long to be a string in the A/UX 3.1 sh.
14001400 cat <<_ACEOF
1401 \`configure' configures libcypher-parser 0.5.0 to adapt to many kinds of systems.
1401 \`configure' configures libcypher-parser 0.5.1 to adapt to many kinds of systems.
14021402
14031403 Usage: $0 [OPTION]... [VAR=VALUE]...
14041404
14691469
14701470 if test -n "$ac_init_help"; then
14711471 case $ac_init_help in
1472 short | recursive ) echo "Configuration of libcypher-parser 0.5.0:";;
1472 short | recursive ) echo "Configuration of libcypher-parser 0.5.1:";;
14731473 esac
14741474 cat <<\_ACEOF
14751475
16091609 test -n "$ac_init_help" && exit $ac_status
16101610 if $ac_init_version; then
16111611 cat <<\_ACEOF
1612 libcypher-parser configure 0.5.0
1612 libcypher-parser configure 0.5.1
16131613 generated by GNU Autoconf 2.69
16141614
16151615 Copyright (C) 2012 Free Software Foundation, Inc.
20742074 This file contains any messages produced by compilers while
20752075 running configure, to aid debugging if configure makes a mistake.
20762076
2077 It was created by libcypher-parser $as_me 0.5.0, which was
2077 It was created by libcypher-parser $as_me 0.5.1, which was
20782078 generated by GNU Autoconf 2.69. Invocation command line was
20792079
20802080 $ $0 $@
29392939
29402940 # Define the identity of the package.
29412941 PACKAGE='libcypher-parser'
2942 VERSION='0.5.0'
2942 VERSION='0.5.1'
29432943
29442944
29452945 cat >>confdefs.h <<_ACEOF
1707817078 # report actual input values of CONFIG_FILES etc. instead of their
1707917079 # values after options handling.
1708017080 ac_log="
17081 This file was extended by libcypher-parser $as_me 0.5.0, which was
17081 This file was extended by libcypher-parser $as_me 0.5.1, which was
1708217082 generated by GNU Autoconf 2.69. Invocation command line was
1708317083
1708417084 CONFIG_FILES = $CONFIG_FILES
1714417144 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1714517145 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1714617146 ac_cs_version="\\
17147 libcypher-parser config.status 0.5.0
17147 libcypher-parser config.status 0.5.1
1714817148 configured by $0, generated by GNU Autoconf 2.69,
1714917149 with options \\"\$ac_cs_config\\"
1715017150
1313 #
1414 dnl Process this file with autoconf to produce a configure script
1515 AC_PREREQ([2.69])
16 AC_INIT([libcypher-parser],[0.5.0])
16 AC_INIT([libcypher-parser],[0.5.1])
1717 AC_CONFIG_SRCDIR([src/lib/cypher-parser.h])
1818 AC_CONFIG_MACRO_DIR([m4])
1919 AM_INIT_AUTOMAKE([foreign])
0 libcypher-parser (0.5.1-1) unstable; urgency=medium
1
2 * New upstream release.
3
4 -- Chris Leishman <chris@leishman.org> Mon, 15 Aug 2016 15:22:16 +0000
5
06 libcypher-parser (0.5.0-1) unstable; urgency=medium
17
28 * New upstream release.
486486 cypher_parser_new_config@Base 0.5.0
487487 cypher_parser_no_colorization@Base 0.5.0
488488 cypher_quick_fparse@Base 0.5.0
489 cypher_quick_parse_segment_get_next@Base 0.5.1
489490 cypher_quick_parse_segment_get_range@Base 0.5.0
490491 cypher_quick_parse_segment_get_text@Base 0.5.0
491492 cypher_quick_parse_segment_is_command@Base 0.5.0
142142 # increment age.
143143 # 4. If any interfaces have been removed or changed since the last public
144144 # release, then set age to 0.
145 libcypher_parser_la_LDFLAGS = -version-info 8:0:0
145 libcypher_parser_la_LDFLAGS = -version-info 9:0:1
146146
147147 parser.c: parser_leg.c
148148 quick_parser.c: quick_parser_leg.c
620620 # increment age.
621621 # 4. If any interfaces have been removed or changed since the last public
622622 # release, then set age to 0.
623 libcypher_parser_la_LDFLAGS = -version-info 8:0:0
623 libcypher_parser_la_LDFLAGS = -version-info 9:0:1
624624 EXTRA_DIST = parser_leg.c quick_parser_leg.c
625625 MAINTAINERCLEANFILES = parser_leg.c quick_parser_leg.c
626626 all: all-am
57195719 const cypher_quick_parse_segment_t *segment);
57205720
57215721 /**
5722 * Get the next input position that will be parsed.
5723 *
5724 * @param [segment] The parse segment.
5725 * @return The input position.
5726 */
5727 __cypherlang_pure
5728 struct cypher_input_position cypher_quick_parse_segment_get_next(
5729 const cypher_quick_parse_segment_t *segment);
5730
5731 /**
57225732 * Check if the quick parse encountered the end of the input.
57235733 *
57245734 * Indicates if the segment was terminated by to the end of the input.
238238 const char *ptr;
239239 size_t length;
240240 struct cypher_input_range range;
241 struct cypher_input_position next;
241242 bool eof;
242243 };
243244
262263 .ptr = yy->__buf + yy->__begin,
263264 .length = yy->__end - yy->__begin,
264265 .range = { .start = start, .end = end },
266 .next = consumed_offset,
265267 .eof = yy->eof };
266268
267269 yy->result = yy->callback(yy->callback_data, &segment);
310312 const cypher_quick_parse_segment_t *segment)
311313 {
312314 return segment->range;
315 }
316
317
318 struct cypher_input_position cypher_quick_parse_segment_get_next(
319 const cypher_quick_parse_segment_t *segment)
320 {
321 return segment->next;
313322 }
314323
315324
2222 | '\\;'
2323 | '\\' -- line-end
2424 | block-comment
25 | unclosed-block-comment
2526 | quoted
2627 | !(';' | -- line-end) .
2728 )*
2829
2930 statement = - < statement-body > - ( ';' | EOF )
3031 { segment(true, yy); }
31 statement-body = (comment | quoted | escaped-char | !(- ';') .)*
32 statement-body =
33 ( comment
34 | quoted
35 | unclosed-block-comment
36 | escaped-char
37 | !(- ';') .
38 )*
3239
3340 quoted = single-quoted | double-quoted
34 single-quoted = "'" (escaped-char | EOL | !"'" .)* "'"
35 double-quoted = '"' (escaped-char | EOL | !'"' .)* '"'
41 single-quoted = "'" (escaped-char | EOL | !"'" .)* ("'" | EOF)
42 double-quoted = '"' (escaped-char | EOL | !'"' .)* ('"' | EOF)
3643
3744 escaped-char = '\\' [abfnrtv"'?\\]
3845
4350 comment = line-comment | block-comment
4451 line-comment = '//' (!EOL .)* (EOL | EOF)
4552 block-comment = '/*' (EOL | !'*/' .)* '*/'
53 unclosed-block-comment = '/*' (EOL | !'*/' .)* EOF
4654
4755 WS = HWS | EOL
4856 HWS = [ \t]
22 #include <stdio.h>
33 #include <stdlib.h>
44 #include <string.h>
5 #define YYRULECOUNT 20
5 #define YYRULECOUNT 21
66 #ifndef YY_MALLOC
77 #define YY_MALLOC(C, N) malloc(N)
88 #endif
271271
272272 #define YYACCEPT yyAccept(yy, yythunkpos0)
273273
274 YY_RULE(int) yy__line_start_(yycontext *yy); /* 20 */
275 YY_RULE(int) yy_line_comment(yycontext *yy); /* 19 */
276 YY_RULE(int) yy_HWS(yycontext *yy); /* 18 */
277 YY_RULE(int) yy_WS(yycontext *yy); /* 17 */
278 YY_RULE(int) yy_EOL(yycontext *yy); /* 16 */
279 YY_RULE(int) yy_double_quoted(yycontext *yy); /* 15 */
280 YY_RULE(int) yy_single_quoted(yycontext *yy); /* 14 */
281 YY_RULE(int) yy_comment(yycontext *yy); /* 13 */
282 YY_RULE(int) yy_EOF(yycontext *yy); /* 12 */
283 YY_RULE(int) yy_statement_body(yycontext *yy); /* 11 */
284 YY_RULE(int) yy_quoted(yycontext *yy); /* 10 */
274 YY_RULE(int) yy__line_start_(yycontext *yy); /* 21 */
275 YY_RULE(int) yy_line_comment(yycontext *yy); /* 20 */
276 YY_RULE(int) yy_HWS(yycontext *yy); /* 19 */
277 YY_RULE(int) yy_WS(yycontext *yy); /* 18 */
278 YY_RULE(int) yy_EOL(yycontext *yy); /* 17 */
279 YY_RULE(int) yy_double_quoted(yycontext *yy); /* 16 */
280 YY_RULE(int) yy_single_quoted(yycontext *yy); /* 15 */
281 YY_RULE(int) yy_comment(yycontext *yy); /* 14 */
282 YY_RULE(int) yy_EOF(yycontext *yy); /* 13 */
283 YY_RULE(int) yy_statement_body(yycontext *yy); /* 12 */
284 YY_RULE(int) yy_quoted(yycontext *yy); /* 11 */
285 YY_RULE(int) yy_unclosed_block_comment(yycontext *yy); /* 10 */
285286 YY_RULE(int) yy_block_comment(yycontext *yy); /* 9 */
286287 YY_RULE(int) yy_escaped_char(yycontext *yy); /* 8 */
287288 YY_RULE(int) yy_line_end(yycontext *yy); /* 7 */
416417 }
417418 l18:; goto l16;
418419 l17:; yy->__pos= yypos17; yy->__thunkpos= yythunkpos17;
419 } if (!yymatchChar(yy, '"')) goto l15;
420 }
421 { int yypos22= yy->__pos, yythunkpos22= yy->__thunkpos; if (!yymatchChar(yy, '"')) goto l23; goto l22;
422 l23:; yy->__pos= yypos22; yy->__thunkpos= yythunkpos22; if (!yy_EOF(yy)) goto l15;
423 }
424 l22:;
420425 yyprintf((stderr, " ok %s @ %s\n", "double_quoted", yy->__buf+yy->__pos));
421426 return 1;
422427 l15:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
425430 }
426431 YY_RULE(int) yy_single_quoted(yycontext *yy)
427432 { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
428 yyprintf((stderr, "%s\n", "single_quoted")); if (!yymatchChar(yy, '\'')) goto l22;
429 l23:;
430 { int yypos24= yy->__pos, yythunkpos24= yy->__thunkpos;
431 { int yypos25= yy->__pos, yythunkpos25= yy->__thunkpos; if (!yy_escaped_char(yy)) goto l26; goto l25;
432 l26:; yy->__pos= yypos25; yy->__thunkpos= yythunkpos25; if (!yy_EOL(yy)) goto l27; goto l25;
433 l27:; yy->__pos= yypos25; yy->__thunkpos= yythunkpos25;
434 { int yypos28= yy->__pos, yythunkpos28= yy->__thunkpos; if (!yymatchChar(yy, '\'')) goto l28; goto l24;
435 l28:; yy->__pos= yypos28; yy->__thunkpos= yythunkpos28;
436 } if (!yymatchDot(yy)) goto l24;
437 }
438 l25:; goto l23;
439 l24:; yy->__pos= yypos24; yy->__thunkpos= yythunkpos24;
440 } if (!yymatchChar(yy, '\'')) goto l22;
433 yyprintf((stderr, "%s\n", "single_quoted")); if (!yymatchChar(yy, '\'')) goto l24;
434 l25:;
435 { int yypos26= yy->__pos, yythunkpos26= yy->__thunkpos;
436 { int yypos27= yy->__pos, yythunkpos27= yy->__thunkpos; if (!yy_escaped_char(yy)) goto l28; goto l27;
437 l28:; yy->__pos= yypos27; yy->__thunkpos= yythunkpos27; if (!yy_EOL(yy)) goto l29; goto l27;
438 l29:; yy->__pos= yypos27; yy->__thunkpos= yythunkpos27;
439 { int yypos30= yy->__pos, yythunkpos30= yy->__thunkpos; if (!yymatchChar(yy, '\'')) goto l30; goto l26;
440 l30:; yy->__pos= yypos30; yy->__thunkpos= yythunkpos30;
441 } if (!yymatchDot(yy)) goto l26;
442 }
443 l27:; goto l25;
444 l26:; yy->__pos= yypos26; yy->__thunkpos= yythunkpos26;
445 }
446 { int yypos31= yy->__pos, yythunkpos31= yy->__thunkpos; if (!yymatchChar(yy, '\'')) goto l32; goto l31;
447 l32:; yy->__pos= yypos31; yy->__thunkpos= yythunkpos31; if (!yy_EOF(yy)) goto l24;
448 }
449 l31:;
441450 yyprintf((stderr, " ok %s @ %s\n", "single_quoted", yy->__buf+yy->__pos));
442451 return 1;
443 l22:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
452 l24:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
444453 yyprintf((stderr, " fail %s @ %s\n", "single_quoted", yy->__buf+yy->__pos));
445454 return 0;
446455 }
447456 YY_RULE(int) yy_comment(yycontext *yy)
448457 { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
449458 yyprintf((stderr, "%s\n", "comment"));
450 { int yypos30= yy->__pos, yythunkpos30= yy->__thunkpos; if (!yy_line_comment(yy)) goto l31; goto l30;
451 l31:; yy->__pos= yypos30; yy->__thunkpos= yythunkpos30; if (!yy_block_comment(yy)) goto l29;
452 }
453 l30:;
459 { int yypos34= yy->__pos, yythunkpos34= yy->__thunkpos; if (!yy_line_comment(yy)) goto l35; goto l34;
460 l35:; yy->__pos= yypos34; yy->__thunkpos= yythunkpos34; if (!yy_block_comment(yy)) goto l33;
461 }
462 l34:;
454463 yyprintf((stderr, " ok %s @ %s\n", "comment", yy->__buf+yy->__pos));
455464 return 1;
456 l29:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
465 l33:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
457466 yyprintf((stderr, " fail %s @ %s\n", "comment", yy->__buf+yy->__pos));
458467 return 0;
459468 }
460469 YY_RULE(int) yy_EOF(yycontext *yy)
461470 { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
462471 yyprintf((stderr, "%s\n", "EOF"));
463 { int yypos33= yy->__pos, yythunkpos33= yy->__thunkpos; if (!yymatchDot(yy)) goto l33; goto l32;
464 l33:; yy->__pos= yypos33; yy->__thunkpos= yythunkpos33;
472 { int yypos37= yy->__pos, yythunkpos37= yy->__thunkpos; if (!yymatchDot(yy)) goto l37; goto l36;
473 l37:; yy->__pos= yypos37; yy->__thunkpos= yythunkpos37;
465474 } yyDo(yy, yy_1_EOF, yy->__begin, yy->__end);
466475 yyprintf((stderr, " ok %s @ %s\n", "EOF", yy->__buf+yy->__pos));
467476 return 1;
468 l32:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
477 l36:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
469478 yyprintf((stderr, " fail %s @ %s\n", "EOF", yy->__buf+yy->__pos));
470479 return 0;
471480 }
472481 YY_RULE(int) yy_statement_body(yycontext *yy)
473482 {
474483 yyprintf((stderr, "%s\n", "statement_body"));
475 l35:;
476 { int yypos36= yy->__pos, yythunkpos36= yy->__thunkpos;
477 { int yypos37= yy->__pos, yythunkpos37= yy->__thunkpos; if (!yy_comment(yy)) goto l38; goto l37;
478 l38:; yy->__pos= yypos37; yy->__thunkpos= yythunkpos37; if (!yy_quoted(yy)) goto l39; goto l37;
479 l39:; yy->__pos= yypos37; yy->__thunkpos= yythunkpos37; if (!yy_escaped_char(yy)) goto l40; goto l37;
480 l40:; yy->__pos= yypos37; yy->__thunkpos= yythunkpos37;
481 { int yypos41= yy->__pos, yythunkpos41= yy->__thunkpos; if (!yy__(yy)) goto l41; if (!yymatchChar(yy, ';')) goto l41; goto l36;
482 l41:; yy->__pos= yypos41; yy->__thunkpos= yythunkpos41;
483 } if (!yymatchDot(yy)) goto l36;
484 }
485 l37:; goto l35;
486 l36:; yy->__pos= yypos36; yy->__thunkpos= yythunkpos36;
484 l39:;
485 { int yypos40= yy->__pos, yythunkpos40= yy->__thunkpos;
486 { int yypos41= yy->__pos, yythunkpos41= yy->__thunkpos; if (!yy_comment(yy)) goto l42; goto l41;
487 l42:; yy->__pos= yypos41; yy->__thunkpos= yythunkpos41; if (!yy_quoted(yy)) goto l43; goto l41;
488 l43:; yy->__pos= yypos41; yy->__thunkpos= yythunkpos41; if (!yy_unclosed_block_comment(yy)) goto l44; goto l41;
489 l44:; yy->__pos= yypos41; yy->__thunkpos= yythunkpos41; if (!yy_escaped_char(yy)) goto l45; goto l41;
490 l45:; yy->__pos= yypos41; yy->__thunkpos= yythunkpos41;
491 { int yypos46= yy->__pos, yythunkpos46= yy->__thunkpos; if (!yy__(yy)) goto l46; if (!yymatchChar(yy, ';')) goto l46; goto l40;
492 l46:; yy->__pos= yypos46; yy->__thunkpos= yythunkpos46;
493 } if (!yymatchDot(yy)) goto l40;
494 }
495 l41:; goto l39;
496 l40:; yy->__pos= yypos40; yy->__thunkpos= yythunkpos40;
487497 }
488498 yyprintf((stderr, " ok %s @ %s\n", "statement_body", yy->__buf+yy->__pos));
489499 return 1;
491501 YY_RULE(int) yy_quoted(yycontext *yy)
492502 { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
493503 yyprintf((stderr, "%s\n", "quoted"));
494 { int yypos43= yy->__pos, yythunkpos43= yy->__thunkpos; if (!yy_single_quoted(yy)) goto l44; goto l43;
495 l44:; yy->__pos= yypos43; yy->__thunkpos= yythunkpos43; if (!yy_double_quoted(yy)) goto l42;
496 }
497 l43:;
504 { int yypos48= yy->__pos, yythunkpos48= yy->__thunkpos; if (!yy_single_quoted(yy)) goto l49; goto l48;
505 l49:; yy->__pos= yypos48; yy->__thunkpos= yythunkpos48; if (!yy_double_quoted(yy)) goto l47;
506 }
507 l48:;
498508 yyprintf((stderr, " ok %s @ %s\n", "quoted", yy->__buf+yy->__pos));
499509 return 1;
500 l42:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
510 l47:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
501511 yyprintf((stderr, " fail %s @ %s\n", "quoted", yy->__buf+yy->__pos));
502512 return 0;
503513 }
514 YY_RULE(int) yy_unclosed_block_comment(yycontext *yy)
515 { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
516 yyprintf((stderr, "%s\n", "unclosed_block_comment")); if (!yymatchString(yy, "/*")) goto l50;
517 l51:;
518 { int yypos52= yy->__pos, yythunkpos52= yy->__thunkpos;
519 { int yypos53= yy->__pos, yythunkpos53= yy->__thunkpos; if (!yy_EOL(yy)) goto l54; goto l53;
520 l54:; yy->__pos= yypos53; yy->__thunkpos= yythunkpos53;
521 { int yypos55= yy->__pos, yythunkpos55= yy->__thunkpos; if (!yymatchString(yy, "*/")) goto l55; goto l52;
522 l55:; yy->__pos= yypos55; yy->__thunkpos= yythunkpos55;
523 } if (!yymatchDot(yy)) goto l52;
524 }
525 l53:; goto l51;
526 l52:; yy->__pos= yypos52; yy->__thunkpos= yythunkpos52;
527 } if (!yy_EOF(yy)) goto l50;
528 yyprintf((stderr, " ok %s @ %s\n", "unclosed_block_comment", yy->__buf+yy->__pos));
529 return 1;
530 l50:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
531 yyprintf((stderr, " fail %s @ %s\n", "unclosed_block_comment", yy->__buf+yy->__pos));
532 return 0;
533 }
504534 YY_RULE(int) yy_block_comment(yycontext *yy)
505535 { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
506 yyprintf((stderr, "%s\n", "block_comment")); if (!yymatchString(yy, "/*")) goto l45;
507 l46:;
508 { int yypos47= yy->__pos, yythunkpos47= yy->__thunkpos;
509 { int yypos48= yy->__pos, yythunkpos48= yy->__thunkpos; if (!yy_EOL(yy)) goto l49; goto l48;
510 l49:; yy->__pos= yypos48; yy->__thunkpos= yythunkpos48;
511 { int yypos50= yy->__pos, yythunkpos50= yy->__thunkpos; if (!yymatchString(yy, "*/")) goto l50; goto l47;
512 l50:; yy->__pos= yypos50; yy->__thunkpos= yythunkpos50;
513 } if (!yymatchDot(yy)) goto l47;
514 }
515 l48:; goto l46;
516 l47:; yy->__pos= yypos47; yy->__thunkpos= yythunkpos47;
517 } if (!yymatchString(yy, "*/")) goto l45;
518 yyprintf((stderr, " ok %s @ %s\n", "block_comment", yy->__buf+yy->__pos));
519 return 1;
520 l45:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
521 yyprintf((stderr, " fail %s @ %s\n", "block_comment", yy->__buf+yy->__pos));
522 return 0;
523 }
524 YY_RULE(int) yy_escaped_char(yycontext *yy)
525 { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
526 yyprintf((stderr, "%s\n", "escaped_char")); if (!yymatchChar(yy, '\\')) goto l51; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\204\000\000\200\000\000\000\020\106\100\124\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l51;
527 yyprintf((stderr, " ok %s @ %s\n", "escaped_char", yy->__buf+yy->__pos));
528 return 1;
529 l51:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
530 yyprintf((stderr, " fail %s @ %s\n", "escaped_char", yy->__buf+yy->__pos));
531 return 0;
532 }
533 YY_RULE(int) yy_line_end(yycontext *yy)
534 { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
535 yyprintf((stderr, "%s\n", "line_end"));
536 { int yypos53= yy->__pos, yythunkpos53= yy->__thunkpos; if (!yy_line_comment(yy)) goto l54; goto l53;
537 l54:; yy->__pos= yypos53; yy->__thunkpos= yythunkpos53; if (!yy_EOL(yy)) goto l55; goto l53;
538 l55:; yy->__pos= yypos53; yy->__thunkpos= yythunkpos53; if (!yy_EOF(yy)) goto l52;
539 }
540 l53:;
541 yyprintf((stderr, " ok %s @ %s\n", "line_end", yy->__buf+yy->__pos));
542 return 1;
543 l52:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
544 yyprintf((stderr, " fail %s @ %s\n", "line_end", yy->__buf+yy->__pos));
545 return 0;
546 }
547 YY_RULE(int) yy___(yycontext *yy)
548 {
549 yyprintf((stderr, "%s\n", "__"));
536 yyprintf((stderr, "%s\n", "block_comment")); if (!yymatchString(yy, "/*")) goto l56;
550537 l57:;
551538 { int yypos58= yy->__pos, yythunkpos58= yy->__thunkpos;
552 { int yypos59= yy->__pos, yythunkpos59= yy->__thunkpos; if (!yy_HWS(yy)) goto l60; goto l59;
553 l60:; yy->__pos= yypos59; yy->__thunkpos= yythunkpos59; if (!yy_block_comment(yy)) goto l58;
539 { int yypos59= yy->__pos, yythunkpos59= yy->__thunkpos; if (!yy_EOL(yy)) goto l60; goto l59;
540 l60:; yy->__pos= yypos59; yy->__thunkpos= yythunkpos59;
541 { int yypos61= yy->__pos, yythunkpos61= yy->__thunkpos; if (!yymatchString(yy, "*/")) goto l61; goto l58;
542 l61:; yy->__pos= yypos61; yy->__thunkpos= yythunkpos61;
543 } if (!yymatchDot(yy)) goto l58;
554544 }
555545 l59:; goto l57;
556546 l58:; yy->__pos= yypos58; yy->__thunkpos= yythunkpos58;
547 } if (!yymatchString(yy, "*/")) goto l56;
548 yyprintf((stderr, " ok %s @ %s\n", "block_comment", yy->__buf+yy->__pos));
549 return 1;
550 l56:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
551 yyprintf((stderr, " fail %s @ %s\n", "block_comment", yy->__buf+yy->__pos));
552 return 0;
553 }
554 YY_RULE(int) yy_escaped_char(yycontext *yy)
555 { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
556 yyprintf((stderr, "%s\n", "escaped_char")); if (!yymatchChar(yy, '\\')) goto l62; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\204\000\000\200\000\000\000\020\106\100\124\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l62;
557 yyprintf((stderr, " ok %s @ %s\n", "escaped_char", yy->__buf+yy->__pos));
558 return 1;
559 l62:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
560 yyprintf((stderr, " fail %s @ %s\n", "escaped_char", yy->__buf+yy->__pos));
561 return 0;
562 }
563 YY_RULE(int) yy_line_end(yycontext *yy)
564 { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
565 yyprintf((stderr, "%s\n", "line_end"));
566 { int yypos64= yy->__pos, yythunkpos64= yy->__thunkpos; if (!yy_line_comment(yy)) goto l65; goto l64;
567 l65:; yy->__pos= yypos64; yy->__thunkpos= yythunkpos64; if (!yy_EOL(yy)) goto l66; goto l64;
568 l66:; yy->__pos= yypos64; yy->__thunkpos= yythunkpos64; if (!yy_EOF(yy)) goto l63;
569 }
570 l64:;
571 yyprintf((stderr, " ok %s @ %s\n", "line_end", yy->__buf+yy->__pos));
572 return 1;
573 l63:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
574 yyprintf((stderr, " fail %s @ %s\n", "line_end", yy->__buf+yy->__pos));
575 return 0;
576 }
577 YY_RULE(int) yy___(yycontext *yy)
578 {
579 yyprintf((stderr, "%s\n", "__"));
580 l68:;
581 { int yypos69= yy->__pos, yythunkpos69= yy->__thunkpos;
582 { int yypos70= yy->__pos, yythunkpos70= yy->__thunkpos; if (!yy_HWS(yy)) goto l71; goto l70;
583 l71:; yy->__pos= yypos70; yy->__thunkpos= yythunkpos70; if (!yy_block_comment(yy)) goto l69;
584 }
585 l70:; goto l68;
586 l69:; yy->__pos= yypos69; yy->__thunkpos= yythunkpos69;
557587 }
558588 yyprintf((stderr, " ok %s @ %s\n", "__", yy->__buf+yy->__pos));
559589 return 1;
561591 YY_RULE(int) yy_command_body(yycontext *yy)
562592 {
563593 yyprintf((stderr, "%s\n", "command_body"));
564 l62:;
565 { int yypos63= yy->__pos, yythunkpos63= yy->__thunkpos;
566 { int yypos64= yy->__pos, yythunkpos64= yy->__thunkpos; if (!yy_escaped_char(yy)) goto l65; goto l64;
567 l65:; yy->__pos= yypos64; yy->__thunkpos= yythunkpos64; if (!yymatchString(yy, "\\;")) goto l66; goto l64;
568 l66:; yy->__pos= yypos64; yy->__thunkpos= yythunkpos64; if (!yymatchChar(yy, '\\')) goto l67; if (!yy___(yy)) goto l67; if (!yy_line_end(yy)) goto l67; goto l64;
569 l67:; yy->__pos= yypos64; yy->__thunkpos= yythunkpos64; if (!yy_block_comment(yy)) goto l68; goto l64;
570 l68:; yy->__pos= yypos64; yy->__thunkpos= yythunkpos64; if (!yy_quoted(yy)) goto l69; goto l64;
571 l69:; yy->__pos= yypos64; yy->__thunkpos= yythunkpos64;
572 { int yypos70= yy->__pos, yythunkpos70= yy->__thunkpos;
573 { int yypos71= yy->__pos, yythunkpos71= yy->__thunkpos; if (!yymatchChar(yy, ';')) goto l72; goto l71;
574 l72:; yy->__pos= yypos71; yy->__thunkpos= yythunkpos71; if (!yy___(yy)) goto l70; if (!yy_line_end(yy)) goto l70;
575 }
576 l71:; goto l63;
577 l70:; yy->__pos= yypos70; yy->__thunkpos= yythunkpos70;
578 } if (!yymatchDot(yy)) goto l63;
579 }
580 l64:; goto l62;
581 l63:; yy->__pos= yypos63; yy->__thunkpos= yythunkpos63;
594 l73:;
595 { int yypos74= yy->__pos, yythunkpos74= yy->__thunkpos;
596 { int yypos75= yy->__pos, yythunkpos75= yy->__thunkpos; if (!yy_escaped_char(yy)) goto l76; goto l75;
597 l76:; yy->__pos= yypos75; yy->__thunkpos= yythunkpos75; if (!yymatchString(yy, "\\;")) goto l77; goto l75;
598 l77:; yy->__pos= yypos75; yy->__thunkpos= yythunkpos75; if (!yymatchChar(yy, '\\')) goto l78; if (!yy___(yy)) goto l78; if (!yy_line_end(yy)) goto l78; goto l75;
599 l78:; yy->__pos= yypos75; yy->__thunkpos= yythunkpos75; if (!yy_block_comment(yy)) goto l79; goto l75;
600 l79:; yy->__pos= yypos75; yy->__thunkpos= yythunkpos75; if (!yy_unclosed_block_comment(yy)) goto l80; goto l75;
601 l80:; yy->__pos= yypos75; yy->__thunkpos= yythunkpos75; if (!yy_quoted(yy)) goto l81; goto l75;
602 l81:; yy->__pos= yypos75; yy->__thunkpos= yythunkpos75;
603 { int yypos82= yy->__pos, yythunkpos82= yy->__thunkpos;
604 { int yypos83= yy->__pos, yythunkpos83= yy->__thunkpos; if (!yymatchChar(yy, ';')) goto l84; goto l83;
605 l84:; yy->__pos= yypos83; yy->__thunkpos= yythunkpos83; if (!yy___(yy)) goto l82; if (!yy_line_end(yy)) goto l82;
606 }
607 l83:; goto l74;
608 l82:; yy->__pos= yypos82; yy->__thunkpos= yythunkpos82;
609 } if (!yymatchDot(yy)) goto l74;
610 }
611 l75:; goto l73;
612 l74:; yy->__pos= yypos74; yy->__thunkpos= yythunkpos74;
582613 }
583614 yyprintf((stderr, " ok %s @ %s\n", "command_body", yy->__buf+yy->__pos));
584615 return 1;
586617 YY_RULE(int) yy__(yycontext *yy)
587618 {
588619 yyprintf((stderr, "%s\n", "_"));
589 l74:;
590 { int yypos75= yy->__pos, yythunkpos75= yy->__thunkpos;
591 { int yypos76= yy->__pos, yythunkpos76= yy->__thunkpos; if (!yy_WS(yy)) goto l77; goto l76;
592 l77:; yy->__pos= yypos76; yy->__thunkpos= yythunkpos76; if (!yy_comment(yy)) goto l75;
593 }
594 l76:; goto l74;
595 l75:; yy->__pos= yypos75; yy->__thunkpos= yythunkpos75;
620 l86:;
621 { int yypos87= yy->__pos, yythunkpos87= yy->__thunkpos;
622 { int yypos88= yy->__pos, yythunkpos88= yy->__thunkpos; if (!yy_WS(yy)) goto l89; goto l88;
623 l89:; yy->__pos= yypos88; yy->__thunkpos= yythunkpos88; if (!yy_comment(yy)) goto l87;
624 }
625 l88:; goto l86;
626 l87:; yy->__pos= yypos87; yy->__thunkpos= yythunkpos87;
596627 }
597628 yyprintf((stderr, " ok %s @ %s\n", "_", yy->__buf+yy->__pos));
598629 return 1;
599630 }
600631 YY_RULE(int) yy_statement(yycontext *yy)
601632 { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
602 yyprintf((stderr, "%s\n", "statement")); if (!yy__(yy)) goto l78; yyText(yy, yy->__begin, yy->__end); {
633 yyprintf((stderr, "%s\n", "statement")); if (!yy__(yy)) goto l90; yyText(yy, yy->__begin, yy->__end); {
603634 #define yytext yy->__text
604635 #define yyleng yy->__textlen
605 if (!(YY_BEGIN)) goto l78;
636 if (!(YY_BEGIN)) goto l90;
606637 #undef yytext
607638 #undef yyleng
608 } if (!yy_statement_body(yy)) goto l78; yyText(yy, yy->__begin, yy->__end); {
639 } if (!yy_statement_body(yy)) goto l90; yyText(yy, yy->__begin, yy->__end); {
609640 #define yytext yy->__text
610641 #define yyleng yy->__textlen
611 if (!(YY_END)) goto l78;
642 if (!(YY_END)) goto l90;
612643 #undef yytext
613644 #undef yyleng
614 } if (!yy__(yy)) goto l78;
615 { int yypos79= yy->__pos, yythunkpos79= yy->__thunkpos; if (!yymatchChar(yy, ';')) goto l80; goto l79;
616 l80:; yy->__pos= yypos79; yy->__thunkpos= yythunkpos79; if (!yy_EOF(yy)) goto l78;
617 }
618 l79:; yyDo(yy, yy_1_statement, yy->__begin, yy->__end);
645 } if (!yy__(yy)) goto l90;
646 { int yypos91= yy->__pos, yythunkpos91= yy->__thunkpos; if (!yymatchChar(yy, ';')) goto l92; goto l91;
647 l92:; yy->__pos= yypos91; yy->__thunkpos= yythunkpos91; if (!yy_EOF(yy)) goto l90;
648 }
649 l91:; yyDo(yy, yy_1_statement, yy->__begin, yy->__end);
619650 yyprintf((stderr, " ok %s @ %s\n", "statement", yy->__buf+yy->__pos));
620651 return 1;
621 l78:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
652 l90:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
622653 yyprintf((stderr, " fail %s @ %s\n", "statement", yy->__buf+yy->__pos));
623654 return 0;
624655 }
625656 YY_RULE(int) yy_client_command(yycontext *yy)
626657 { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
627 yyprintf((stderr, "%s\n", "client_command")); if (!yy__(yy)) goto l81; yyText(yy, yy->__begin, yy->__end); {
658 yyprintf((stderr, "%s\n", "client_command")); if (!yy__(yy)) goto l93; yyText(yy, yy->__begin, yy->__end); {
628659 #define yytext yy->__text
629660 #define yyleng yy->__textlen
630 if (!(YY_BEGIN)) goto l81;
661 if (!(YY_BEGIN)) goto l93;
631662 #undef yytext
632663 #undef yyleng
633 } if (!yymatchChar(yy, ':')) goto l81; if (!yy_command_body(yy)) goto l81; yyText(yy, yy->__begin, yy->__end); {
664 } if (!yymatchChar(yy, ':')) goto l93; if (!yy_command_body(yy)) goto l93; yyText(yy, yy->__begin, yy->__end); {
634665 #define yytext yy->__text
635666 #define yyleng yy->__textlen
636 if (!(YY_END)) goto l81;
667 if (!(YY_END)) goto l93;
637668 #undef yytext
638669 #undef yyleng
639 } if (!yy___(yy)) goto l81;
640 { int yypos82= yy->__pos, yythunkpos82= yy->__thunkpos; if (!yymatchChar(yy, ';')) goto l83; goto l82;
641 l83:; yy->__pos= yypos82; yy->__thunkpos= yythunkpos82; if (!yy_line_end(yy)) goto l81;
642 }
643 l82:; yyDo(yy, yy_1_client_command, yy->__begin, yy->__end);
670 } if (!yy___(yy)) goto l93;
671 { int yypos94= yy->__pos, yythunkpos94= yy->__thunkpos; if (!yymatchChar(yy, ';')) goto l95; goto l94;
672 l95:; yy->__pos= yypos94; yy->__thunkpos= yythunkpos94; if (!yy_line_end(yy)) goto l93;
673 }
674 l94:; yyDo(yy, yy_1_client_command, yy->__begin, yy->__end);
644675 yyprintf((stderr, " ok %s @ %s\n", "client_command", yy->__buf+yy->__pos));
645676 return 1;
646 l81:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
677 l93:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
647678 yyprintf((stderr, " fail %s @ %s\n", "client_command", yy->__buf+yy->__pos));
648679 return 0;
649680 }
650681 YY_RULE(int) yy_directive(yycontext *yy)
651682 { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
652683 yyprintf((stderr, "%s\n", "directive"));
653 { int yypos85= yy->__pos, yythunkpos85= yy->__thunkpos; if (!yy_client_command(yy)) goto l86; goto l85;
654 l86:; yy->__pos= yypos85; yy->__thunkpos= yythunkpos85; if (!yy_statement(yy)) goto l84;
655 }
656 l85:;
684 { int yypos97= yy->__pos, yythunkpos97= yy->__thunkpos; if (!yy_client_command(yy)) goto l98; goto l97;
685 l98:; yy->__pos= yypos97; yy->__thunkpos= yythunkpos97; if (!yy_statement(yy)) goto l96;
686 }
687 l97:;
657688 yyprintf((stderr, " ok %s @ %s\n", "directive", yy->__buf+yy->__pos));
658689 return 1;
659 l84:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
690 l96:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
660691 yyprintf((stderr, " fail %s @ %s\n", "directive", yy->__buf+yy->__pos));
661692 return 0;
662693 }
2626 static bool is_statement[MAX_SEGMENTS];
2727 static char *segments[MAX_SEGMENTS];
2828 static struct cypher_input_range ranges[MAX_SEGMENTS];
29 static struct cypher_input_position nexts[MAX_SEGMENTS];
2930 static bool eofs[MAX_SEGMENTS];
3031
3132
3536 memset(is_statement, 0, sizeof(is_statement));
3637 memset(segments, 0, sizeof(segments));
3738 memset(ranges, 0, sizeof(ranges));
39 memset(nexts, 0, sizeof(nexts));
3840 memset(eofs, 0, sizeof(eofs));
3941 }
4042
5860 segments[nsegments] = strndup(s, n);
5961 ck_assert(segments[nsegments] != NULL);
6062 ranges[nsegments] = cypher_quick_parse_segment_get_range(segment);
63 nexts[nsegments] = cypher_quick_parse_segment_get_next(segment);
6164 eofs[nsegments] = cypher_quick_parse_segment_is_eof(segment);
6265 ++nsegments;
6366 return 0;
8790 ck_assert_int_eq(ranges[0].end.line, 1);
8891 ck_assert_int_eq(ranges[0].end.column, 1);
8992 ck_assert_int_eq(ranges[0].end.offset, 0);
93 ck_assert_int_eq(nexts[0].line, 1);
94 ck_assert_int_eq(nexts[0].column, 2);
95 ck_assert_int_eq(nexts[0].offset, 1);
9096 ck_assert(!eofs[0]);
9197 }
9298 END_TEST
106112 ck_assert_int_eq(ranges[0].end.line, 1);
107113 ck_assert_int_eq(ranges[0].end.column, 3);
108114 ck_assert_int_eq(ranges[0].end.offset, 2);
115 ck_assert_int_eq(nexts[0].line, 1);
116 ck_assert_int_eq(nexts[0].column, 4);
117 ck_assert_int_eq(nexts[0].offset, 3);
109118 ck_assert(!eofs[0]);
110119
111120 ck_assert(is_statement[1]);
116125 ck_assert_int_eq(ranges[1].end.line, 1);
117126 ck_assert_int_eq(ranges[1].end.column, 5);
118127 ck_assert_int_eq(ranges[1].end.offset, 4);
128 ck_assert_int_eq(nexts[1].line, 1);
129 ck_assert_int_eq(nexts[1].column, 5);
130 ck_assert_int_eq(nexts[1].offset, 4);
119131 ck_assert(eofs[1]);
120132 }
121133 END_TEST
135147 ck_assert_int_eq(ranges[0].end.line, 1);
136148 ck_assert_int_eq(ranges[0].end.column, 9);
137149 ck_assert_int_eq(ranges[0].end.offset, 8);
150 ck_assert_int_eq(nexts[0].line, 1);
151 ck_assert_int_eq(nexts[0].column, 10);
152 ck_assert_int_eq(nexts[0].offset, 9);
138153 ck_assert(!eofs[0]);
139154 }
140155 END_TEST
155170 ck_assert_int_eq(ranges[0].end.line, 1);
156171 ck_assert_int_eq(ranges[0].end.column, 9);
157172 ck_assert_int_eq(ranges[0].end.offset, 8);
173 ck_assert_int_eq(nexts[0].line, 1);
174 ck_assert_int_eq(nexts[0].column, 10);
175 ck_assert_int_eq(nexts[0].offset, 9);
158176 ck_assert(!eofs[0]);
159177
160178 ck_assert(is_statement[1]);
165183 ck_assert_int_eq(ranges[1].end.line, 1);
166184 ck_assert_int_eq(ranges[1].end.column, 19);
167185 ck_assert_int_eq(ranges[1].end.offset, 18);
186 ck_assert_int_eq(nexts[1].line, 1);
187 ck_assert_int_eq(nexts[1].column, 20);
188 ck_assert_int_eq(nexts[1].offset, 19);
168189 ck_assert(!eofs[1]);
169190
170191 ck_assert(is_statement[2]);
175196 ck_assert_int_eq(ranges[2].end.line, 2);
176197 ck_assert_int_eq(ranges[2].end.column, 12);
177198 ck_assert_int_eq(ranges[2].end.offset, 31);
199 ck_assert_int_eq(nexts[2].line, 2);
200 ck_assert_int_eq(nexts[2].column, 17);
201 ck_assert_int_eq(nexts[2].offset, 36);
178202 ck_assert(!eofs[2]);
179203 }
180204 END_TEST
195219 ck_assert_int_eq(ranges[0].end.line, 1);
196220 ck_assert_int_eq(ranges[0].end.column, 14);
197221 ck_assert_int_eq(ranges[0].end.offset, 13);
222 ck_assert_int_eq(nexts[0].line, 2);
223 ck_assert_int_eq(nexts[0].column, 1);
224 ck_assert_int_eq(nexts[0].offset, 14);
198225 ck_assert(!eofs[0]);
199226 }
200227 END_TEST
215242 ck_assert_int_eq(ranges[0].end.line, 1);
216243 ck_assert_int_eq(ranges[0].end.column, 9);
217244 ck_assert_int_eq(ranges[0].end.offset, 8);
245 ck_assert_int_eq(nexts[0].line, 1);
246 ck_assert_int_eq(nexts[0].column, 10);
247 ck_assert_int_eq(nexts[0].offset, 9);
218248 ck_assert(!eofs[0]);
219249
220250 ck_assert(is_statement[1]);
225255 ck_assert_int_eq(ranges[1].end.line, 2);
226256 ck_assert_int_eq(ranges[1].end.column, 10);
227257 ck_assert_int_eq(ranges[1].end.offset, 33);
258 ck_assert_int_eq(nexts[1].line, 2);
259 ck_assert_int_eq(nexts[1].column, 11);
260 ck_assert_int_eq(nexts[1].offset, 34);
228261 ck_assert(!eofs[1]);
229262 }
230263 END_TEST
245278 ck_assert_int_eq(ranges[0].end.line, 1);
246279 ck_assert_int_eq(ranges[0].end.column, 9);
247280 ck_assert_int_eq(ranges[0].end.offset, 8);
281 ck_assert_int_eq(nexts[0].line, 1);
282 ck_assert_int_eq(nexts[0].column, 10);
283 ck_assert_int_eq(nexts[0].offset, 9);
248284 ck_assert(!eofs[0]);
249285
250286 ck_assert(is_statement[1]);
255291 ck_assert_int_eq(ranges[1].end.line, 1);
256292 ck_assert_int_eq(ranges[1].end.column, 19);
257293 ck_assert_int_eq(ranges[1].end.offset, 18);
294 ck_assert_int_eq(nexts[1].line, 1);
295 ck_assert_int_eq(nexts[1].column, 19);
296 ck_assert_int_eq(nexts[1].offset, 18);
258297 ck_assert(eofs[1]);
259298 }
260299 END_TEST
275314 ck_assert_int_eq(ranges[0].end.line, 1);
276315 ck_assert_int_eq(ranges[0].end.column, 5);
277316 ck_assert_int_eq(ranges[0].end.offset, 4);
317 ck_assert_int_eq(nexts[0].line, 2);
318 ck_assert_int_eq(nexts[0].column, 1);
319 ck_assert_int_eq(nexts[0].offset, 5);
278320 ck_assert(!eofs[0]);
279321
280322 ck_assert(!is_statement[1]);
285327 ck_assert_int_eq(ranges[1].end.line, 2);
286328 ck_assert_int_eq(ranges[1].end.column, 14);
287329 ck_assert_int_eq(ranges[1].end.offset, 18);
330 ck_assert_int_eq(nexts[1].line, 2);
331 ck_assert_int_eq(nexts[1].column, 14);
332 ck_assert_int_eq(nexts[1].offset, 18);
288333 ck_assert(eofs[1]);
289334 }
290335 END_TEST
305350 ck_assert_int_eq(ranges[0].end.line, 1);
306351 ck_assert_int_eq(ranges[0].end.column, 8);
307352 ck_assert_int_eq(ranges[0].end.offset, 7);
353 ck_assert_int_eq(nexts[0].line, 2);
354 ck_assert_int_eq(nexts[0].column, 1);
355 ck_assert_int_eq(nexts[0].offset, 8);
308356 ck_assert(!eofs[0]);
309357
310358 ck_assert(!is_statement[1]);
315363 ck_assert_int_eq(ranges[1].end.line, 2);
316364 ck_assert_int_eq(ranges[1].end.column, 3);
317365 ck_assert_int_eq(ranges[1].end.offset, 10);
366 ck_assert_int_eq(nexts[1].line, 2);
367 ck_assert_int_eq(nexts[1].column, 4);
368 ck_assert_int_eq(nexts[1].offset, 11);
318369 ck_assert(!eofs[1]);
319370
320371 ck_assert(!is_statement[2]);
325376 ck_assert_int_eq(ranges[2].end.line, 2);
326377 ck_assert_int_eq(ranges[2].end.column, 13);
327378 ck_assert_int_eq(ranges[2].end.offset, 20);
379 ck_assert_int_eq(nexts[2].line, 2);
380 ck_assert_int_eq(nexts[2].column, 25);
381 ck_assert_int_eq(nexts[2].offset, 32);
328382 ck_assert(eofs[2]);
329383 }
330384 END_TEST
346400 ck_assert_int_eq(ranges[0].end.line, 3);
347401 ck_assert_int_eq(ranges[0].end.column, 9);
348402 ck_assert_int_eq(ranges[0].end.offset, 34);
403 ck_assert_int_eq(nexts[0].line, 4);
404 ck_assert_int_eq(nexts[0].column, 1);
405 ck_assert_int_eq(nexts[0].offset, 46);
349406 ck_assert(!eofs[0]);
350407 }
351408 END_TEST
367424 ck_assert_int_eq(ranges[0].end.line, 1);
368425 ck_assert_int_eq(ranges[0].end.column, 26);
369426 ck_assert_int_eq(ranges[0].end.offset, 25);
427 ck_assert_int_eq(nexts[0].line, 2);
428 ck_assert_int_eq(nexts[0].column, 1);
429 ck_assert_int_eq(nexts[0].offset, 26);
370430 ck_assert(!eofs[0]);
371431 }
372432 END_TEST
388448 ck_assert_int_eq(ranges[0].end.line, 2);
389449 ck_assert_int_eq(ranges[0].end.column, 11);
390450 ck_assert_int_eq(ranges[0].end.offset, 23);
451 ck_assert_int_eq(nexts[0].line, 3);
452 ck_assert_int_eq(nexts[0].column, 1);
453 ck_assert_int_eq(nexts[0].offset, 24);
391454 ck_assert(!eofs[0]);
392455 }
393456 END_TEST
409472 ck_assert_int_eq(ranges[0].end.line, 1);
410473 ck_assert_int_eq(ranges[0].end.column, 8);
411474 ck_assert_int_eq(ranges[0].end.offset, 7);
475 ck_assert_int_eq(nexts[0].line, 2);
476 ck_assert_int_eq(nexts[0].column, 1);
477 ck_assert_int_eq(nexts[0].offset, 13);
412478 ck_assert(!eofs[0]);
413479
414480 ck_assert(!is_statement[1]);
419485 ck_assert_int_eq(ranges[1].end.line, 2);
420486 ck_assert_int_eq(ranges[1].end.column, 20);
421487 ck_assert_int_eq(ranges[1].end.offset, 32);
488 ck_assert_int_eq(nexts[1].line, 3);
489 ck_assert_int_eq(nexts[1].column, 1);
490 ck_assert_int_eq(nexts[1].offset, 33);
422491 ck_assert(!eofs[1]);
423492
424493 ck_assert(!is_statement[2]);
429498 ck_assert_int_eq(ranges[2].end.line, 3);
430499 ck_assert_int_eq(ranges[2].end.column, 18);
431500 ck_assert_int_eq(ranges[2].end.offset, 50);
501 ck_assert_int_eq(nexts[2].line, 3);
502 ck_assert_int_eq(nexts[2].column, 18);
503 ck_assert_int_eq(nexts[2].offset, 50);
432504 ck_assert(eofs[2]);
505 }
506 END_TEST
507
508
509 START_TEST (parse_statement_with_concluding_block_comment)
510 {
511 int result = cypher_quick_parse(
512 " return 1 /* s;hunter */;",
513 segment_callback, NULL, 0);
514 ck_assert_int_eq(result, 0);
515 ck_assert_int_eq(nsegments, 1);
516
517 ck_assert(is_statement[0]);
518 ck_assert_str_eq(segments[0], "return 1");
519 ck_assert_int_eq(ranges[0].start.line, 1);
520 ck_assert_int_eq(ranges[0].start.column, 2);
521 ck_assert_int_eq(ranges[0].start.offset, 1);
522 ck_assert_int_eq(ranges[0].end.line, 1);
523 ck_assert_int_eq(ranges[0].end.column, 10);
524 ck_assert_int_eq(ranges[0].end.offset, 9);
525 ck_assert_int_eq(nexts[0].line, 1);
526 ck_assert_int_eq(nexts[0].column, 26);
527 ck_assert_int_eq(nexts[0].offset, 25);
528 ck_assert(!eofs[0]);
529 }
530 END_TEST
531
532
533 START_TEST (parse_command_with_concluding_block_comment)
534 {
535 int result = cypher_quick_parse(
536 ":hunter /* s\nthompson */\n",
537 segment_callback, NULL, 0);
538 ck_assert_int_eq(result, 0);
539 ck_assert_int_eq(nsegments, 1);
540
541 ck_assert(!is_statement[0]);
542 ck_assert_str_eq(segments[0], ":hunter");
543 ck_assert_int_eq(ranges[0].start.line, 1);
544 ck_assert_int_eq(ranges[0].start.column, 1);
545 ck_assert_int_eq(ranges[0].start.offset, 0);
546 ck_assert_int_eq(ranges[0].end.line, 1);
547 ck_assert_int_eq(ranges[0].end.column, 8);
548 ck_assert_int_eq(ranges[0].end.offset, 7);
549 ck_assert_int_eq(nexts[0].line, 3);
550 ck_assert_int_eq(nexts[0].column, 1);
551 ck_assert_int_eq(nexts[0].offset, 25);
552 ck_assert(!eofs[0]);
553 }
554 END_TEST
555
556
557 START_TEST (parse_statement_with_unclosed_block_comment)
558 {
559 int result = cypher_quick_parse(
560 "return 1 /* hunter;thompson\n",
561 segment_callback, NULL, 0);
562 ck_assert_int_eq(result, 0);
563 ck_assert_int_eq(nsegments, 1);
564
565 ck_assert(is_statement[0]);
566 ck_assert_str_eq(segments[0], "return 1 /* hunter;thompson\n");
567 ck_assert_int_eq(ranges[0].start.line, 1);
568 ck_assert_int_eq(ranges[0].start.column, 1);
569 ck_assert_int_eq(ranges[0].start.offset, 0);
570 ck_assert_int_eq(ranges[0].end.line, 2);
571 ck_assert_int_eq(ranges[0].end.column, 1);
572 ck_assert_int_eq(ranges[0].end.offset, 28);
573 ck_assert_int_eq(nexts[0].line, 2);
574 ck_assert_int_eq(nexts[0].column, 1);
575 ck_assert_int_eq(nexts[0].offset, 28);
576 ck_assert(eofs[0]);
577 }
578 END_TEST
579
580
581 START_TEST (parse_command_with_unclosed_block_comment)
582 {
583 int result = cypher_quick_parse(
584 ":hunter /* s\nthompson\n",
585 segment_callback, NULL, 0);
586 ck_assert_int_eq(result, 0);
587 ck_assert_int_eq(nsegments, 1);
588
589 ck_assert(!is_statement[0]);
590 ck_assert_str_eq(segments[0], ":hunter /* s\nthompson\n");
591 ck_assert_int_eq(ranges[0].start.line, 1);
592 ck_assert_int_eq(ranges[0].start.column, 1);
593 ck_assert_int_eq(ranges[0].start.offset, 0);
594 ck_assert_int_eq(ranges[0].end.line, 3);
595 ck_assert_int_eq(ranges[0].end.column, 1);
596 ck_assert_int_eq(ranges[0].end.offset, 22);
597 ck_assert_int_eq(nexts[0].line, 3);
598 ck_assert_int_eq(nexts[0].column, 1);
599 ck_assert_int_eq(nexts[0].offset, 22);
600 ck_assert(eofs[0]);
601 }
602 END_TEST
603
604
605 START_TEST (parse_statement_with_unclosed_quote)
606 {
607 int result = cypher_quick_parse(
608 "return 's;thompson",
609 segment_callback, NULL, 0);
610 ck_assert_int_eq(result, 0);
611 ck_assert_int_eq(nsegments, 1);
612
613 ck_assert(is_statement[0]);
614 ck_assert_str_eq(segments[0], "return 's;thompson");
615 ck_assert_int_eq(ranges[0].start.line, 1);
616 ck_assert_int_eq(ranges[0].start.column, 1);
617 ck_assert_int_eq(ranges[0].start.offset, 0);
618 ck_assert_int_eq(ranges[0].end.line, 1);
619 ck_assert_int_eq(ranges[0].end.column, 19);
620 ck_assert_int_eq(ranges[0].end.offset, 18);
621 ck_assert_int_eq(nexts[0].line, 1);
622 ck_assert_int_eq(nexts[0].column, 19);
623 ck_assert_int_eq(nexts[0].offset, 18);
624 ck_assert(eofs[0]);
625 }
626 END_TEST
627
628
629 START_TEST (parse_command_with_unclosed_quote)
630 {
631 int result = cypher_quick_parse(
632 ":hunter \"s\nthompson",
633 segment_callback, NULL, 0);
634 ck_assert_int_eq(result, 0);
635 ck_assert_int_eq(nsegments, 1);
636
637 ck_assert(!is_statement[0]);
638 ck_assert_str_eq(segments[0], ":hunter \"s\nthompson");
639 ck_assert_int_eq(ranges[0].start.line, 1);
640 ck_assert_int_eq(ranges[0].start.column, 1);
641 ck_assert_int_eq(ranges[0].start.offset, 0);
642 ck_assert_int_eq(ranges[0].end.line, 2);
643 ck_assert_int_eq(ranges[0].end.column, 9);
644 ck_assert_int_eq(ranges[0].end.offset, 19);
645 ck_assert_int_eq(nexts[0].line, 2);
646 ck_assert_int_eq(nexts[0].column, 9);
647 ck_assert_int_eq(nexts[0].offset, 19);
648 ck_assert(eofs[0]);
433649 }
434650 END_TEST
435651
452668 tcase_add_test(tc, parse_command_with_escape_chars);
453669 tcase_add_test(tc, parse_command_with_block_comment);
454670 tcase_add_test(tc, parse_command_with_line_comment);
671 tcase_add_test(tc, parse_statement_with_concluding_block_comment);
672 tcase_add_test(tc, parse_command_with_concluding_block_comment);
673 tcase_add_test(tc, parse_statement_with_unclosed_block_comment);
674 tcase_add_test(tc, parse_command_with_unclosed_block_comment);
675 tcase_add_test(tc, parse_statement_with_unclosed_quote);
676 tcase_add_test(tc, parse_command_with_unclosed_quote);
455677 return tc;
456678 }