diff -Nru yabasic-2.82.0/bison.c yabasic-2.82.1/bison.c --- yabasic-2.82.0/bison.c 2019-02-19 18:05:23.000000000 +0000 +++ yabasic-2.82.1/bison.c 2019-03-11 20:17:47.000000000 +0000 @@ -122,9 +122,13 @@ int loop_nesting=0; int switch_nesting=0; -void report_if_missing(int severity,char *text) { +void report_if_missing(int severity,char *text,int eof) { if (missing_loop || missing_endif || missing_next || missing_until || missing_wend) { - error(severity,text); + if (eof) { + error_without_position(severity,text); + } else { + error(severity,text); + } string[0]='\0'; if (missing_endif) sprintf(string,"if-statement starting at line %d has seen no 'endif' yet",missing_endif_line); @@ -136,7 +140,9 @@ sprintf(string,"repeat-loop starting at line %d has seen no 'until' yet",missing_until_line); else if (missing_loop) sprintf(string,"do-loop starting at line %d has seen no 'loop' yet",missing_loop_line); - if (string[0]) error(severity,string); + if (string[0]) { + error_without_position(severity,string); + } } } @@ -392,7 +398,7 @@ void yyerror(char *message) { - error(ERROR,message); + error(sERROR,message); } void @@ -715,50 +721,50 @@ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 147, 147, 150, 151, 151, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 173, 174, 174, 175, 176, - 177, 178, 179, 180, 181, 181, 183, 183, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 195, - 196, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 213, 214, 215, 216, 217, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 264, 265, 266, - 267, 268, 272, 273, 274, 275, 276, 277, 280, 281, - 284, 285, 286, 287, 288, 291, 292, 295, 296, 299, - 300, 301, 302, 303, 304, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, 339, 342, 343, - 346, 346, 347, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 380, 383, 386, 389, 390, 391, - 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 443, 444, 445, 446, 447, 448, 449, 450, 453, - 454, 455, 458, 459, 460, 463, 464, 467, 468, 469, - 470, 473, 476, 479, 479, 482, 483, 484, 487, 488, - 491, 492, 495, 491, 500, 501, 504, 505, 508, 509, - 510, 511, 514, 515, 518, 519, 520, 521, 524, 525, - 528, 529, 530, 531, 534, 535, 536, 539, 540, 541, - 542, 545, 546, 550, 564, 545, 569, 570, 573, 574, - 577, 578, 583, 583, 587, 588, 591, 592, 596, 598, - 597, 602, 603, 603, 607, 607, 613, 614, 618, 619, - 618, 625, 626, 630, 630, 635, 636, 640, 641, 641, - 643, 640, 647, 648, 651, 651, 655, 656, 659, 661, - 663, 660, 667, 668, 671, 672, 672, 675, 676, 678, - 679, 683, 684, 687, 688, 690, 691, 695, 696, 697, - 698, 701, 702, 703, 704, 705, 708, 709, 710, 713, - 713, 714, 714, 715, 715, 716, 716, 717, 717, 720, - 721, 724, 725, 726, 727, 728, 729, 730, 731, 732, - 733, 734, 735, 736, 737, 740, 741, 743, 744, 747, - 748 + 0, 153, 153, 156, 157, 157, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 179, 180, 180, 181, 182, + 183, 184, 185, 186, 187, 187, 189, 189, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 201, + 202, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 219, 220, 221, 222, 223, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 270, 271, 272, + 273, 274, 278, 279, 280, 281, 282, 283, 286, 287, + 290, 291, 292, 293, 294, 297, 298, 301, 302, 305, + 306, 307, 308, 309, 310, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 348, 349, + 352, 352, 353, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 386, 389, 392, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 455, 456, 459, + 460, 461, 464, 465, 466, 469, 470, 473, 474, 475, + 476, 479, 482, 485, 485, 488, 489, 490, 493, 494, + 497, 498, 501, 497, 506, 507, 510, 511, 514, 515, + 516, 517, 520, 521, 524, 525, 526, 527, 530, 531, + 534, 535, 536, 537, 540, 541, 542, 545, 546, 547, + 548, 551, 552, 556, 570, 551, 575, 576, 579, 580, + 583, 584, 589, 589, 593, 594, 597, 598, 602, 604, + 603, 608, 609, 609, 613, 613, 619, 620, 624, 625, + 624, 631, 632, 636, 636, 641, 642, 646, 647, 647, + 649, 646, 653, 654, 657, 657, 661, 662, 665, 667, + 669, 666, 673, 674, 677, 678, 678, 681, 682, 684, + 685, 689, 690, 693, 694, 696, 697, 701, 702, 703, + 704, 707, 708, 709, 710, 711, 714, 715, 716, 719, + 719, 720, 720, 721, 721, 722, 722, 723, 723, 726, + 727, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 746, 747, 749, 750, 753, + 754 }; #endif @@ -3153,13 +3159,13 @@ case 4: - {if (errorlevel<=ERROR) {YYABORT;}} + {if (severity_so_far >= sERROR) {YYABORT;}} break; case 11: - {report_if_missing(ERROR,"can not import a library in a loop or an if-statement");} + {report_if_missing(sERROR,"can not import a library in a loop or an if-statement",FALSE);} break; @@ -3171,19 +3177,19 @@ case 18: - {add_command(cPOP_MULTI,NULL,NULL);create_mybreak(1);if (!loop_nesting && !switch_nesting) lyyerror((yylsp[0]),ERROR,"break outside loop or switch");} + {add_command(cPOP_MULTI,NULL,NULL);create_mybreak(1);if (!loop_nesting && !switch_nesting) lyyerror((yylsp[0]),sERROR,"break outside loop or switch");} break; case 19: - {add_command(cPOP_MULTI,NULL,NULL);create_mybreak(atoi((yyvsp[0].digits)));if (!loop_nesting && !switch_nesting) lyyerror((yylsp[-1]),ERROR,"break outside loop or switch");} + {add_command(cPOP_MULTI,NULL,NULL);create_mybreak(atoi((yyvsp[0].digits)));if (!loop_nesting && !switch_nesting) lyyerror((yylsp[-1]),sERROR,"break outside loop or switch");} break; case 20: - {add_command(cPOP_MULTI,NULL,NULL);add_command_with_switch_state(cCONTINUE);if (!loop_nesting) lyyerror((yylsp[0]),ERROR,"continue outside loop");} + {add_command(cPOP_MULTI,NULL,NULL);add_command_with_switch_state(cCONTINUE);if (!loop_nesting) lyyerror((yylsp[0]),sERROR,"continue outside loop");} break; @@ -3201,13 +3207,13 @@ case 24: - {if (function_type==ftNONE) lyyerror((yylsp[0]),ERROR,"no use for 'local' outside functions");} + {if (function_type==ftNONE) lyyerror((yylsp[0]),sERROR,"no use for 'local' outside functions");} break; case 26: - {if (function_type==ftNONE) lyyerror((yylsp[0]),ERROR,"no use for 'static' outside functions");} + {if (function_type==ftNONE) lyyerror((yylsp[0]),sERROR,"no use for 'static' outside functions");} break; @@ -3382,13 +3388,13 @@ case 61: - {if (function_type==ftNONE) {lyyerror((yylsp[-1]),ERROR,"a value can only be returned from a subroutine"); YYABORT;} add_command(cCLEARREFS,NULL,NULL);lastcmd->nextref=firstref;add_command(cPOPSYMLIST,NULL,NULL);create_check_return_value(ftNUMBER,function_type);add_command(cRETURN_FROM_CALL,NULL,NULL);} + {if (function_type==ftNONE) {lyyerror((yylsp[-1]),sERROR,"a value can only be returned from a subroutine"); YYABORT;} add_command(cCLEARREFS,NULL,NULL);lastcmd->nextref=firstref;add_command(cPOPSYMLIST,NULL,NULL);create_check_return_value(ftNUMBER,function_type);add_command(cRETURN_FROM_CALL,NULL,NULL);} break; case 62: - {if (function_type==ftNONE) {lyyerror((yylsp[-1]),ERROR,"can not return value"); YYABORT;} add_command(cCLEARREFS,NULL,NULL);lastcmd->nextref=firstref;add_command(cPOPSYMLIST,NULL,NULL);create_check_return_value(ftSTRING,function_type);add_command(cRETURN_FROM_CALL,NULL,NULL);} + {if (function_type==ftNONE) {lyyerror((yylsp[-1]),sERROR,"can not return value"); YYABORT;} add_command(cCLEARREFS,NULL,NULL);lastcmd->nextref=firstref;add_command(cPOPSYMLIST,NULL,NULL);create_check_return_value(ftSTRING,function_type);add_command(cRETURN_FROM_CALL,NULL,NULL);} break; @@ -3785,7 +3791,7 @@ case 132: - {if ((yyvsp[0].string)==NULL) {lyyerror((yylsp[0]),ERROR,"String not terminated");create_pushstr("");} else {create_pushstr((yyvsp[0].string));}} + {if ((yyvsp[0].string)==NULL) {lyyerror((yylsp[0]),sERROR,"String not terminated");create_pushstr("");} else {create_pushstr((yyvsp[0].string));}} break; @@ -4379,7 +4385,7 @@ case 235: - {if (check_compat) lyyerror((yylsp[-5]),WARNING,"instr() has changed in version 2.712"); create_function(fINSTR);} + {if (check_compat) lyyerror((yylsp[-5]),sWARNING,"instr() has changed in version 2.712"); create_function(fINSTR);} break; @@ -4673,7 +4679,7 @@ case 290: - {missing_endsub++;missing_endsub_line=yylineno;pushlabel();report_if_missing(WARNING,"do not define a function in a loop or an if-statement");if (function_type!=ftNONE) {lyyerror((yylsp[-1]),ERROR,"nested functions not allowed");YYABORT;}} + {missing_endsub++;missing_endsub_line=yylineno;pushlabel();report_if_missing(sWARNING,"do not define a function in a loop or an if-statement",FALSE);if (function_type!=ftNONE) {lyyerror((yylsp[-1]),sERROR,"nested functions not allowed");YYABORT;}} break; @@ -4699,7 +4705,7 @@ case 294: - {if (missing_endsub) {sprintf(string,"subroutine starting at line %d has seen no 'end sub' at end of file",missing_endsub_line);lyyerror((yylsp[0]),ERROR,string);} YYABORT;} + {if (missing_endsub) {sprintf(string,"subroutine starting at line %d has seen no 'end sub' at end of program",missing_endsub_line);error_without_position(sERROR,string);} YYABORT;} break; @@ -4865,7 +4871,7 @@ case 326: - {if (missing_next) {sprintf(string,"for-loop starting at line %d has seen not 'next' at end of file",missing_next_line);lyyerror((yylsp[0]),ERROR,string);} YYABORT;} + {if (missing_next) {sprintf(string,"for-loop starting at line %d has seen no 'next' at end of program",missing_next_line);error_without_position(sERROR,string);} YYABORT;} break; @@ -4890,7 +4896,7 @@ case 331: {if (strcmp(pop(stSTRING)->pointer,dotify((yyvsp[0].symbol),FALSE))) - {lyyerror((yylsp[0]),ERROR,"'for' and 'next' do not match"); YYABORT;} + {lyyerror((yylsp[0]),sERROR,"'for' and 'next' do not match"); YYABORT;} } break; @@ -4933,7 +4939,7 @@ case 346: - {if (missing_loop) {sprintf(string,"do-loop starting at at line %d has seen no 'loop' at end of file",missing_loop_line);lyyerror((yylsp[0]),ERROR,string);} YYABORT;} + {if (missing_loop) {sprintf(string,"do-loop starting at at line %d has seen no 'loop' at end of program",missing_loop_line);error_without_position(sERROR,string);} YYABORT;} break; @@ -4958,7 +4964,7 @@ case 351: - {if (missing_wend) {sprintf(string,"while-loop starting at line %d has seen no 'wend' at end of file",missing_wend_line);lyyerror((yylsp[0]),ERROR,string);} YYABORT;} + {if (missing_wend) {sprintf(string,"while-loop starting at line %d has seen no 'wend' at end of program",missing_wend_line);error_without_position(sERROR,string);} YYABORT;} break; @@ -4976,7 +4982,7 @@ case 355: - {if (missing_until) {sprintf(string,"repeat-loop starting at line %d has seen no 'until' at end of file",missing_until_line);lyyerror((yylsp[0]),ERROR,string);} YYABORT;} + {if (missing_until) {sprintf(string,"repeat-loop starting at line %d has seen no 'until' at end of program",missing_until_line);error_without_position(sERROR,string);} YYABORT;} break; @@ -5012,7 +5018,7 @@ case 362: - {if (missing_endif) {sprintf(string,"if-clause starting at line %d has seen no 'fi' at end of file",missing_endif_line);lyyerror((yylsp[0]),ERROR,string);} YYABORT;} + {if (missing_endif) {sprintf(string,"if-clause starting at line %d has seen no 'fi' at end of program",missing_endif_line);error_without_position(sERROR,string);} YYABORT;} break; diff -Nru yabasic-2.82.0/ChangeLog yabasic-2.82.1/ChangeLog --- yabasic-2.82.0/ChangeLog 2019-02-18 04:54:57.000000000 +0000 +++ yabasic-2.82.1/ChangeLog 2019-03-11 20:18:20.000000000 +0000 @@ -1,3 +1,8 @@ +Version 2.82.1 (March 11, 2019) + - Allowing comments after import statement + - Fixes regarding error messages + + Version 2.82.0 (February 17, 2019) - Advanced version of autoconf and other tools - Fix in tests @@ -6,7 +11,6 @@ - Error messages try to show and mark the offending part of the code - Hexadecimal numerical literals are supported, e.g. print 0xff - Version 2.81.4 (January 27, 2019) - Fixed error with inkey$ and clear screen - Fixed fatal error with inkey$ and upper case letters diff -Nru yabasic-2.82.0/configure yabasic-2.82.1/configure --- yabasic-2.82.0/configure 2019-02-17 17:23:11.000000000 +0000 +++ yabasic-2.82.1/configure 2019-03-11 20:17:35.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for yabasic 2.82.0. +# Generated by GNU Autoconf 2.69 for yabasic 2.82.1. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='yabasic' PACKAGE_TARNAME='yabasic' -PACKAGE_VERSION='2.82.0' -PACKAGE_STRING='yabasic 2.82.0' +PACKAGE_VERSION='2.82.1' +PACKAGE_STRING='yabasic 2.82.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1320,7 +1320,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures yabasic 2.82.0 to adapt to many kinds of systems. +\`configure' configures yabasic 2.82.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1394,7 +1394,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of yabasic 2.82.0:";; + short | recursive ) echo "Configuration of yabasic 2.82.1:";; esac cat <<\_ACEOF @@ -1506,7 +1506,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -yabasic configure 2.82.0 +yabasic configure 2.82.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1925,7 +1925,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by yabasic $as_me 2.82.0, which was +It was created by yabasic $as_me 2.82.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2790,7 +2790,7 @@ # Define the identity of the package. PACKAGE='yabasic' - VERSION='2.82.0' + VERSION='2.82.1' cat >>confdefs.h <<_ACEOF @@ -15301,7 +15301,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by yabasic $as_me 2.82.0, which was +This file was extended by yabasic $as_me 2.82.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15367,7 +15367,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -yabasic config.status 2.82.0 +yabasic config.status 2.82.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru yabasic-2.82.0/configure.ac yabasic-2.82.1/configure.ac --- yabasic-2.82.0/configure.ac 2019-02-17 17:19:44.000000000 +0000 +++ yabasic-2.82.1/configure.ac 2019-03-11 20:17:07.000000000 +0000 @@ -1,7 +1,7 @@ dnl Process this file with 'autoconf' to get a configure-script -AC_INIT([yabasic], [2.82.0]) +AC_INIT([yabasic], [2.82.1]) AC_CONFIG_SRCDIR([main.c]) #AC_CONFIG_LINKS AM_INIT_AUTOMAKE diff -Nru yabasic-2.82.0/debian/changelog yabasic-2.82.1/debian/changelog --- yabasic-2.82.0/debian/changelog 2019-02-20 13:08:52.000000000 +0000 +++ yabasic-2.82.1/debian/changelog 2019-04-02 10:02:24.000000000 +0000 @@ -1,3 +1,11 @@ +yabasic (1:2.82.1-1) experimental; urgency=medium + + * New upstream release + - Allowing comments after import statement + - Fixes regarding error messages + + -- Graham Inggs Tue, 02 Apr 2019 10:02:24 +0000 + yabasic (1:2.82.0-1) unstable; urgency=medium * New upstream release diff -Nru yabasic-2.82.0/flex.c yabasic-2.82.1/flex.c --- yabasic-2.82.0/flex.c 2019-02-19 18:05:24.000000000 +0000 +++ yabasic-2.82.1/flex.c 2019-03-11 20:17:47.000000000 +0000 @@ -390,7 +390,7 @@ flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_acclist[913] = +static yyconst flex_int16_t yy_acclist[916] = { 0, 16386, 4, 4, 14, 14, 213, 211, 212, 1, 211, 212, 7, 212, 199, 211, 212, 211, 212, 200, 211, @@ -483,19 +483,19 @@ 114, 209, 208, 208, 208, 208, 208, 96, 208, 208, 43, 208, 208, 88, 208, 74, 208, 208, 208, 180, 209, 208, 44, 208, 124, 208, 208, 208, 113, 209, - 59, 208, 208, 20, 209, 208, 208, 208, 169, 208, - 127, 208, 208, 208, 208, 208, 101, 208, 208, 126, - 208, 77, 208, 208, 208, 26, 27, 208, 13, 58, - 208, 208, 208, 127, 208, 115, 208, 106, 208, 208, - 208, 208, 78, 208, 208, 28, 29, 116, 209, 208, - 208, 127, 208, 54, 208, 208, 208, 30, 31, 168, - 208, 208, 208, 208, 208, 208, 208, 208, 16, 208, + 59, 208, 208, 20, 209, 208, 13, 208, 208, 169, + 208, 127, 208, 208, 208, 208, 208, 101, 208, 208, + 126, 208, 77, 208, 208, 208, 26, 27, 208, 13, + 58, 208, 208, 208, 127, 208, 115, 208, 106, 208, + 208, 208, 208, 78, 208, 208, 28, 29, 116, 209, + 13, 208, 208, 127, 208, 54, 208, 208, 208, 30, + 31, 13, 168, 208, 208, 208, 208, 208, 208, 208, - 170, 208, 208, 125, 208, 208, 208, 208, 208, 208, - 22, 208 + 208, 16, 208, 170, 208, 208, 125, 208, 208, 208, + 208, 208, 208, 22, 208 } ; -static yyconst flex_int16_t yy_accept[684] = +static yyconst flex_int16_t yy_accept[683] = { 0, 1, 1, 2, 2, 2, 3, 4, 5, 6, 7, 9, 12, 14, 17, 19, 22, 25, 29, 32, 36, @@ -564,14 +564,14 @@ 810, 811, 813, 814, 816, 818, 819, 820, 822, 823, 825, 827, 828, 829, 831, 833, 834, 834, 834, 834, - 834, 836, 837, 837, 838, 839, 841, 843, 844, 845, - 846, 847, 849, 850, 852, 854, 855, 856, 856, 857, - 857, 858, 859, 860, 860, 860, 862, 863, 864, 864, - 864, 866, 868, 870, 871, 872, 873, 875, 876, 877, - 878, 880, 880, 881, 882, 882, 883, 884, 886, 887, - 888, 889, 890, 890, 892, 893, 894, 895, 896, 897, - 898, 899, 901, 903, 904, 906, 907, 908, 909, 910, - 911, 913, 913 + 834, 836, 837, 838, 839, 840, 842, 844, 845, 846, + 847, 848, 850, 851, 853, 855, 856, 857, 857, 858, + 858, 859, 860, 860, 861, 863, 864, 865, 865, 865, + 867, 869, 871, 872, 873, 874, 876, 877, 878, 879, + 881, 882, 883, 884, 884, 885, 886, 888, 889, 890, + 891, 892, 893, 895, 896, 897, 898, 899, 900, 901, + 902, 904, 906, 907, 909, 910, 911, 912, 913, 914, + 916, 916 } ; static yyconst YY_CHAR yy_ec[256] = @@ -618,16 +618,16 @@ 7, 7, 7, 7, 7, 7, 7 } ; -static yyconst flex_uint16_t yy_base[702] = +static yyconst flex_uint16_t yy_base[701] = { 0, - 0, 76, 62, 68, 457, 447, 431, 417, 394, 2792, - 389, 358, 2792, 78, 2792, 345, 70, 309, 74, 80, - 2792, 79, 2792, 280, 2792, 2792, 143, 208, 271, 95, + 0, 76, 62, 68, 457, 447, 431, 417, 394, 2787, + 389, 358, 2787, 78, 2787, 345, 70, 309, 74, 80, + 2787, 79, 2787, 280, 2787, 2787, 143, 208, 271, 95, 337, 406, 97, 100, 136, 98, 469, 177, 160, 189, - 516, 582, 648, 700, 244, 140, 763, 125, 2792, 121, - 280, 276, 161, 231, 2792, 99, 0, 2792, 0, 2792, - 264, 2792, 103, 116, 2792, 2792, 154, 207, 0, 235, - 276, 0, 2792, 2792, 2792, 2792, 0, 138, 227, 256, + 516, 582, 648, 700, 244, 140, 763, 125, 2787, 121, + 280, 276, 161, 231, 2787, 99, 0, 2787, 0, 2787, + 264, 2787, 103, 116, 2787, 2787, 154, 207, 0, 235, + 276, 0, 2787, 2787, 2787, 2787, 0, 138, 227, 256, 261, 260, 308, 265, 312, 335, 339, 305, 333, 323, 353, 342, 363, 408, 392, 380, 381, 431, 426, 409, @@ -638,7 +638,7 @@ 699, 659, 729, 740, 736, 766, 756, 747, 761, 792, 765, 807, 772, 791, 811, 821, 597, 845, 831, 850, 860, 876, 870, 880, 897, 895, 901, 907, 793, 757, - 124, 219, 2792, 217, 2792, 900, 189, 0, 0, 222, + 124, 219, 2787, 217, 2787, 900, 189, 0, 0, 222, 227, 0, 0, 175, 340, 904, 344, 917, 436, 916, 923, 929, 919, 936, 945, 943, 583, 960, 948, 964, @@ -654,135 +654,133 @@ 1334, 1340, 1343, 1346, 1355, 1359, 1360, 1365, 1370, 1372, 1381, 1403, 1397, 1406, 1412, 1413, 1418, 1423, 1424, 1429, - 170, 1430, 1433, 1440, 1442, 1443, 1446, 1452, 2792, 1456, - 1457, 1459, 1458, 1469, 1470, 2792, 1471, 1473, 1482, 1484, + 170, 1430, 1433, 1440, 1442, 1443, 1446, 1452, 2787, 1456, + 1457, 1459, 1458, 1469, 1470, 2787, 1471, 1473, 1482, 1484, 1485, 1489, 1498, 1499, 1501, 1516, 166, 1510, 1521, 1528, 1530, 1505, 1534, 1552, 1553, 1563, 1550, 1565, 1569, 1574, - 1578, 1590, 1594, 1603, 1599, 1610, 1604, 2792, 1608, 1617, + 1578, 1590, 1594, 1603, 1599, 1610, 1604, 2787, 1608, 1617, 1626, 1630, 1631, 1633, 1636, 1637, 1642, 1646, 1647, 1653, - 2792, 1652, 1656, 1667, 1668, 1669, 1672, 1673, 1679, 1688, - 1691, 1700, 1703, 1697, 1704, 157, 2792, 1718, 1706, 1716, + 2787, 1652, 1656, 1667, 1668, 1669, 1672, 1673, 1679, 1688, + 1691, 1700, 1703, 1697, 1704, 157, 2787, 1718, 1706, 1716, 1719, 1731, 1732, 1733, 1747, 1750, 1759, 1766, 1771, 1762, - 1776, 1775, 2792, 1777, 1786, 1789, 1780, 1804, 1805, 1807, + 1776, 1775, 2787, 1777, 1786, 1789, 1780, 1804, 1805, 1807, 1810, 1814, 1816, 1817, 1819, 1820, 1829, 1823, 1832, 1838, 1842, 1843, 1844, 1854, 1858, 1849, 1856, 1870, 1859, 1863, - 1877, 1879, 1890, 1894, 1883, 2792, 1900, 0, 144, 1909, + 1877, 1879, 1890, 1894, 1883, 2787, 1900, 0, 144, 1909, 1903, 1896, 60, 1878, 225, 278, 88, 491, 1915, 1924, 1927, 1928, 1930, 1934, 1939, 1940, 1949, 1950, 1953, 1962, - 1955, 1964, 1966, 1968, 1969, 2792, 1971, 1973, 1975, 1987, - 1989, 1990, 1993, 2792, 1996, 2000, 2007, 2002, 2014, 2011, + 1955, 1964, 1966, 1968, 1969, 2787, 1971, 1973, 1975, 1987, + 1989, 1990, 1993, 2787, 1996, 2000, 2007, 2002, 2014, 2011, 0, 142, 2031, 2027, 2032, 2041, 2050, 2053, 2057, 2066, - 2067, 2070, 2071, 2073, 2076, 2083, 2086, 2792, 2092, 2102, + 2067, 2070, 2071, 2073, 2076, 2083, 2086, 2787, 2092, 2102, - 2792, 2097, 2099, 2101, 2103, 2112, 2119, 2122, 2129, 2124, - 2131, 2134, 2792, 2138, 2149, 2151, 2156, 2161, 2158, 2162, - 2792, 512, 538, 624, 2792, 680, 684, 2163, 2167, 2174, - 2178, 2184, 2196, 2792, 2197, 2792, 2792, 2199, 2200, 2202, + 2787, 2097, 2099, 2101, 2103, 2112, 2119, 2122, 2129, 2124, + 2131, 2134, 2787, 2138, 2149, 2151, 2156, 2161, 2158, 2162, + 2787, 512, 538, 624, 2787, 680, 684, 2163, 2167, 2174, + 2178, 2184, 2196, 2787, 2197, 2787, 2787, 2199, 2200, 2202, 2203, 2209, 2212, 2214, 2215, 2218, 2228, 2230, 2231, 2243, - 2233, 2245, 2792, 2242, 2792, 2248, 2258, 2792, 2261, 2263, - 2273, 2275, 2792, 2277, 2792, 2278, 2279, 2284, 2289, 2288, - 2291, 2792, 2294, 2301, 2304, 2305, 2792, 191, 263, 330, - 461, 2307, 2792, 2308, 128, 2310, 2311, 2317, 2326, 2321, - 2328, 2337, 2344, 2346, 2349, 2353, 2355, 2792, 2360, 2364, - - 2371, 2377, 2376, 2792, 2380, 2386, 729, 782, 800, 814, - 2792, 2387, 735, 2389, 2405, 2407, 2422, 2408, 2412, 2423, - 2428, 2429, 2444, 2440, 2446, 2447, 2456, 841, 2792, 888, - 2792, 2449, 2792, 0, 786, 2460, 2465, 2472, 356, 2475, - 2479, 2476, 2483, 2490, 2488, 2492, 2499, 2503, 118, 107, - 2792, 108, 2504, 2505, 2511, 2792, 2508, 2518, 2519, 2532, - 2792, 2792, 93, 2533, 2534, 2536, 2539, 2543, 2553, 2560, - 2569, 2570, 2567, 2572, 2579, 2581, 2595, 2585, 2596, 2599, - 2605, 2792, 2668, 2676, 2684, 2692, 2697, 2705, 2713, 2721, - 2729, 2737, 2740, 2741, 2746, 2754, 2762, 2769, 2775, 2777, + 2233, 2245, 2787, 2242, 2787, 2248, 2258, 2787, 2261, 2263, + 2273, 2275, 2787, 2277, 2787, 2278, 2279, 2284, 2289, 2288, + 2291, 2787, 2294, 2301, 2304, 2305, 2787, 191, 263, 330, + 461, 2307, 2787, 2308, 128, 2310, 2311, 2317, 2326, 2321, + 2328, 2337, 2344, 2346, 2349, 2353, 2355, 2787, 2360, 2364, + + 2371, 2377, 2376, 2787, 2380, 2386, 729, 782, 800, 814, + 2787, 2387, 110, 2389, 2405, 2407, 2422, 2408, 2412, 2423, + 2428, 2429, 2444, 2440, 2446, 2447, 2456, 841, 2787, 888, + 2787, 2449, 0, 99, 2460, 2465, 2472, 356, 2475, 2479, + 2476, 2483, 2490, 2488, 2492, 2499, 2503, 104, 89, 2787, + 0, 2504, 2505, 2511, 2787, 2508, 2518, 2519, 2532, 2787, + 2787, 0, 2533, 2534, 2536, 2539, 2543, 2553, 2560, 2569, + 2570, 2567, 2572, 2579, 2581, 2595, 2585, 2596, 2599, 2605, + 2787, 2668, 2676, 2684, 2692, 2697, 2705, 2713, 2721, 2729, + 2737, 2740, 2741, 2746, 2754, 2762, 2769, 2773, 2775, 2778 - 2783 } ; -static yyconst flex_int16_t yy_def[702] = +static yyconst flex_int16_t yy_def[701] = { 0, - 682, 1, 683, 683, 684, 684, 685, 685, 682, 682, - 682, 682, 682, 686, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 28, 687, 687, 28, 687, 687, 687, 687, 682, 682, - 688, 689, 682, 682, 682, 682, 690, 682, 691, 682, - 682, 682, 686, 686, 682, 682, 682, 682, 692, 682, - 682, 693, 682, 682, 682, 682, 694, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 682, - 682, 688, 682, 689, 682, 682, 682, 690, 691, 682, - 682, 692, 693, 695, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 695, 687, 687, 687, 687, 687, 687, 687, 682, 687, - 687, 687, 687, 687, 687, 682, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 696, 687, 687, 687, - 682, 682, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 682, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 682, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 697, 682, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - - 687, 687, 682, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 682, 687, 696, 696, 687, - 687, 687, 682, 682, 682, 682, 682, 682, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 682, 687, 687, 687, 687, - 687, 687, 687, 682, 687, 687, 687, 687, 687, 687, - 697, 697, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 682, 687, 687, - - 682, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 682, 687, 687, 687, 687, 687, 687, 687, - 682, 682, 682, 682, 682, 682, 682, 687, 687, 687, - 687, 687, 687, 682, 687, 682, 682, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 682, 687, 682, 687, 687, 682, 687, 687, - 687, 687, 682, 687, 682, 687, 687, 687, 687, 687, - 687, 682, 687, 687, 687, 687, 682, 682, 682, 682, - 682, 687, 682, 687, 698, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 682, 687, 687, - - 687, 687, 687, 682, 687, 687, 682, 682, 682, 682, - 682, 687, 699, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 682, 682, 682, - 682, 687, 682, 700, 699, 687, 687, 687, 682, 682, - 687, 687, 687, 687, 687, 687, 687, 687, 682, 682, - 682, 701, 687, 687, 682, 682, 687, 687, 687, 687, - 682, 682, 701, 687, 687, 687, 687, 687, 687, 687, - 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - 687, 0, 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 681, 1, 682, 682, 683, 683, 684, 684, 681, 681, + 681, 681, 681, 685, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 28, 686, 686, 28, 686, 686, 686, 686, 681, 681, + 687, 688, 681, 681, 681, 681, 689, 681, 690, 681, + 681, 681, 685, 685, 681, 681, 681, 681, 691, 681, + 681, 692, 681, 681, 681, 681, 693, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 681, + 681, 687, 681, 688, 681, 681, 681, 689, 690, 681, + 681, 691, 692, 694, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 694, 686, 686, 686, 686, 686, 686, 686, 681, 686, + 686, 686, 686, 686, 686, 681, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 695, 686, 686, 686, + 681, 681, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 681, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 681, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 696, 681, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + + 686, 686, 681, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 681, 686, 695, 695, 686, + 686, 686, 681, 681, 681, 681, 681, 681, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 681, 686, 686, 686, 686, + 686, 686, 686, 681, 686, 686, 686, 686, 686, 686, + 696, 696, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 681, 686, 686, + + 681, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 681, 686, 686, 686, 686, 686, 686, 686, + 681, 681, 681, 681, 681, 681, 681, 686, 686, 686, + 686, 686, 686, 681, 686, 681, 681, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 681, 686, 681, 686, 686, 681, 686, 686, + 686, 686, 681, 686, 681, 686, 686, 686, 686, 686, + 686, 681, 686, 686, 686, 686, 681, 681, 681, 681, + 681, 686, 681, 686, 697, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 681, 686, 686, + + 686, 686, 686, 681, 686, 686, 681, 681, 681, 681, + 681, 686, 698, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 681, 681, 681, + 681, 686, 699, 698, 686, 686, 686, 681, 681, 686, + 686, 686, 686, 686, 686, 686, 686, 681, 681, 681, + 700, 686, 686, 681, 681, 686, 686, 686, 686, 681, + 681, 700, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 0, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681 - 682 } ; -static yyconst flex_uint16_t yy_nxt[2870] = +static yyconst flex_uint16_t yy_nxt[2865] = { 0, 10, 11, 12, 13, 14, 10, 10, 10, 15, 15, 16, 15, 15, 15, 17, 18, 19, 20, 21, 22, @@ -793,11 +791,11 @@ 35, 36, 37, 38, 39, 40, 41, 36, 42, 43, 44, 45, 46, 47, 48, 36, 36, 50, 56, 56, 64, 51, 65, 52, 56, 56, 67, 67, 70, 521, - 71, 71, 53, 54, 70, 633, 71, 71, 68, 73, + 71, 71, 53, 54, 70, 661, 71, 71, 68, 73, 74, 76, 68, 76, 76, 64, 76, 65, 68, 77, - 633, 77, 77, 662, 77, 177, 177, 521, 64, 97, - 65, 72, 170, 98, 661, 112, 68, 99, 115, 585, + 660, 77, 77, 633, 77, 177, 177, 521, 64, 97, + 65, 72, 170, 98, 633, 112, 68, 99, 115, 585, 68, 76, 113, 100, 526, 114, 68, 171, 171, 77, 171, 171, 76, 482, 76, 439, 76, 97, 72, 76, 77, 98, 77, 112, 77, 99, 115, 77, 482, 113, @@ -822,11 +820,11 @@ 77, 186, 77, 90, 69, 608, 77, 91, 188, 76, 92, 93, 68, 94, 189, 525, 95, 77, 192, 76, 190, 76, 96, 76, 228, 76, 76, 77, 76, 77, - 76, 77, 197, 77, 77, 66, 77, 639, 77, 76, - 62, 198, 189, 193, 640, 199, 192, 77, 190, 76, + 76, 77, 197, 77, 77, 66, 77, 638, 77, 76, + 62, 198, 189, 193, 639, 199, 192, 77, 190, 76, 194, 228, 101, 609, 102, 103, 195, 77, 104, 197, 201, 105, 196, 202, 106, 200, 76, 76, 76, 198, - 61, 193, 199, 682, 77, 77, 77, 194, 76, 101, + 61, 193, 199, 681, 77, 77, 77, 194, 76, 101, 609, 102, 103, 195, 203, 104, 77, 201, 105, 196, 202, 106, 76, 200, 76, 76, 264, 76, 76, 60, @@ -834,274 +832,274 @@ 107, 203, 76, 60, 209, 215, 204, 76, 108, 218, 77, 109, 76, 264, 110, 77, 205, 111, 210, 58, 77, 211, 216, 217, 206, 207, 208, 212, 107, 58, - 213, 209, 214, 215, 204, 682, 108, 218, 109, 76, - 76, 110, 682, 205, 111, 76, 76, 77, 77, 216, - 217, 682, 76, 77, 77, 212, 76, 76, 213, 214, + 213, 209, 214, 215, 204, 681, 108, 218, 109, 76, + 76, 110, 681, 205, 111, 76, 76, 77, 77, 216, + 217, 681, 76, 77, 77, 212, 76, 76, 213, 214, 77, 76, 219, 119, 77, 77, 610, 120, 223, 77, - 76, 121, 224, 682, 220, 221, 76, 122, 77, 225, - 76, 222, 123, 682, 77, 226, 227, 682, 77, 76, + 76, 121, 224, 681, 220, 221, 76, 122, 77, 225, + 76, 222, 123, 681, 77, 226, 227, 681, 77, 76, 219, 119, 527, 610, 230, 120, 223, 77, 231, 121, - 224, 220, 221, 682, 122, 229, 225, 577, 222, 123, + 224, 220, 221, 681, 122, 229, 225, 577, 222, 123, 133, 76, 226, 227, 134, 76, 233, 234, 135, 77, - 527, 232, 230, 77, 136, 231, 682, 137, 76, 76, - 138, 76, 229, 682, 241, 577, 77, 77, 133, 77, + 527, 232, 230, 77, 136, 231, 681, 137, 76, 76, + 138, 76, 229, 681, 241, 577, 77, 77, 133, 77, 578, 76, 134, 233, 234, 76, 135, 76, 232, 77, - 682, 136, 235, 77, 137, 77, 237, 138, 76, 76, + 681, 136, 235, 77, 137, 77, 237, 138, 76, 76, 245, 238, 241, 76, 239, 240, 77, 77, 578, 76, - 682, 77, 251, 76, 682, 259, 139, 77, 258, 235, - 140, 77, 250, 237, 141, 682, 242, 245, 238, 76, + 681, 77, 251, 76, 681, 259, 139, 77, 258, 235, + 140, 77, 250, 237, 141, 681, 242, 245, 238, 76, 254, 239, 240, 76, 243, 142, 143, 77, 326, 251, 244, 77, 259, 297, 139, 258, 77, 255, 140, 250, - 252, 76, 141, 246, 242, 682, 682, 247, 254, 77, + 252, 76, 141, 246, 242, 681, 681, 247, 254, 77, 253, 243, 142, 143, 76, 248, 579, 244, 76, 76, 297, 76, 77, 249, 255, 76, 77, 77, 252, 77, - 76, 246, 682, 77, 144, 247, 145, 253, 77, 262, - 146, 260, 248, 147, 579, 76, 682, 148, 149, 76, + 76, 246, 681, 77, 144, 247, 145, 253, 77, 262, + 146, 260, 248, 147, 579, 76, 681, 148, 149, 76, 249, 150, 151, 77, 152, 76, 153, 77, 256, 257, - 278, 682, 144, 77, 145, 76, 262, 266, 146, 260, + 278, 681, 144, 77, 145, 76, 262, 266, 146, 260, 147, 261, 580, 77, 148, 149, 581, 263, 150, 151, 267, 152, 76, 153, 154, 256, 257, 278, 155, 276, - 77, 156, 157, 682, 266, 76, 277, 633, 158, 261, - 580, 159, 76, 77, 581, 263, 76, 267, 265, 634, - 77, 682, 154, 76, 77, 628, 155, 276, 170, 156, + 77, 156, 157, 681, 266, 76, 277, 681, 158, 261, + 580, 159, 76, 77, 581, 263, 76, 267, 265, 681, + 77, 681, 154, 76, 77, 628, 155, 276, 170, 156, 157, 77, 76, 277, 281, 158, 279, 76, 159, 76, 77, 76, 76, 171, 171, 77, 265, 77, 76, 77, - 77, 280, 285, 628, 284, 682, 77, 164, 633, 682, + 77, 280, 285, 628, 284, 681, 77, 164, 681, 681, 290, 165, 281, 279, 166, 167, 282, 76, 76, 76, - 634, 682, 286, 283, 168, 77, 77, 77, 280, 285, - 629, 682, 284, 76, 292, 164, 287, 76, 290, 165, + 681, 681, 286, 283, 168, 77, 77, 77, 280, 285, + 629, 681, 284, 76, 292, 164, 287, 76, 290, 165, 288, 77, 166, 167, 282, 77, 630, 76, 293, 286, - 283, 168, 76, 289, 310, 77, 682, 76, 629, 291, - 77, 292, 631, 682, 287, 77, 294, 682, 288, 296, - 268, 76, 269, 270, 630, 293, 76, 682, 295, 77, + 283, 168, 76, 289, 310, 77, 681, 76, 629, 291, + 77, 292, 631, 681, 287, 77, 294, 681, 288, 296, + 268, 76, 269, 270, 630, 293, 76, 681, 295, 77, 289, 310, 271, 299, 77, 272, 76, 291, 273, 274, - 631, 275, 649, 294, 77, 300, 76, 296, 268, 298, - 269, 270, 76, 682, 77, 295, 76, 682, 682, 271, - 77, 299, 272, 301, 77, 273, 274, 682, 275, 302, - - 649, 76, 300, 76, 682, 304, 298, 76, 303, 77, - 76, 77, 305, 76, 70, 77, 176, 176, 77, 650, - 301, 77, 76, 76, 682, 76, 302, 307, 68, 76, + 631, 275, 648, 294, 77, 300, 76, 296, 268, 298, + 269, 270, 76, 681, 77, 295, 76, 681, 681, 271, + 77, 299, 272, 301, 77, 273, 274, 681, 275, 302, + + 648, 76, 300, 76, 681, 304, 298, 76, 303, 77, + 76, 77, 305, 76, 70, 77, 176, 176, 77, 649, + 301, 77, 76, 76, 681, 76, 302, 307, 68, 76, 77, 77, 304, 77, 306, 76, 303, 77, 308, 309, - 305, 313, 76, 77, 76, 682, 312, 650, 682, 76, + 305, 313, 76, 77, 76, 681, 312, 649, 681, 76, 77, 319, 77, 314, 76, 307, 68, 77, 317, 77, 315, 306, 77, 316, 327, 308, 76, 309, 321, 313, - 76, 318, 320, 312, 77, 76, 323, 682, 77, 682, - 314, 682, 682, 77, 322, 317, 76, 315, 682, 76, - 316, 682, 327, 76, 77, 76, 321, 77, 318, 324, + 76, 318, 320, 312, 77, 76, 323, 681, 77, 681, + 314, 681, 681, 77, 322, 317, 76, 315, 681, 76, + 316, 681, 327, 76, 77, 76, 321, 77, 318, 324, 320, 77, 76, 77, 323, 325, 76, 328, 76, 76, - 77, 76, 322, 76, 77, 76, 77, 77, 682, 77, - 682, 77, 329, 77, 682, 330, 324, 682, 331, 334, - 76, 336, 325, 335, 682, 328, 76, 337, 77, 332, - 76, 682, 76, 682, 77, 333, 76, 682, 77, 329, - 77, 341, 330, 682, 77, 331, 76, 334, 339, 336, - 682, 335, 340, 342, 77, 76, 332, 76, 76, 76, - 682, 76, 333, 77, 682, 77, 77, 77, 344, 77, - 338, 76, 343, 682, 76, 358, 339, 345, 346, 77, - 340, 76, 77, 77, 76, 76, 682, 682, 76, 77, + 77, 76, 322, 76, 77, 76, 77, 77, 681, 77, + 681, 77, 329, 77, 681, 330, 324, 681, 331, 334, + 76, 336, 325, 335, 681, 328, 76, 337, 77, 332, + 76, 681, 76, 681, 77, 333, 76, 681, 77, 329, + 77, 341, 330, 681, 77, 331, 76, 334, 339, 336, + 681, 335, 340, 342, 77, 76, 332, 76, 76, 76, + 681, 76, 333, 77, 681, 77, 77, 77, 344, 77, + 338, 76, 343, 681, 76, 358, 339, 345, 346, 77, + 340, 76, 77, 77, 76, 76, 681, 681, 76, 77, - 350, 348, 77, 77, 347, 344, 77, 338, 682, 682, + 350, 348, 77, 77, 347, 344, 77, 338, 681, 681, 343, 76, 76, 76, 352, 345, 346, 349, 76, 77, - 77, 77, 682, 351, 682, 76, 77, 350, 348, 76, - 353, 347, 355, 77, 360, 76, 356, 77, 682, 682, + 77, 77, 681, 351, 681, 76, 77, 350, 348, 76, + 353, 347, 355, 77, 360, 76, 356, 77, 681, 681, 76, 76, 352, 77, 349, 76, 76, 354, 77, 77, - 351, 76, 682, 77, 77, 682, 361, 357, 353, 77, - 355, 359, 360, 356, 682, 682, 682, 363, 364, 682, - 76, 76, 362, 366, 354, 682, 682, 365, 77, 77, - 682, 682, 76, 361, 357, 76, 76, 682, 359, 367, - 77, 682, 76, 77, 77, 363, 364, 371, 76, 362, + 351, 76, 681, 77, 77, 681, 361, 357, 353, 77, + 355, 359, 360, 356, 681, 681, 681, 363, 364, 681, + 76, 76, 362, 366, 354, 681, 681, 365, 77, 77, + 681, 681, 76, 361, 357, 76, 76, 681, 359, 367, + 77, 681, 76, 77, 77, 363, 364, 371, 76, 362, - 77, 366, 76, 76, 365, 77, 77, 369, 76, 682, + 77, 366, 76, 76, 365, 77, 77, 369, 76, 681, 77, 77, 370, 76, 76, 368, 77, 367, 76, 76, 76, 77, 77, 76, 76, 76, 77, 77, 77, 76, - 682, 77, 77, 77, 682, 369, 76, 77, 76, 372, - 370, 76, 368, 376, 77, 76, 77, 379, 682, 77, - 373, 374, 378, 77, 375, 682, 377, 381, 682, 76, + 681, 77, 77, 77, 681, 369, 76, 77, 76, 372, + 370, 76, 368, 376, 77, 76, 77, 379, 681, 77, + 373, 374, 378, 77, 375, 681, 377, 381, 681, 76, 380, 76, 383, 386, 387, 76, 372, 77, 76, 77, - 682, 376, 76, 77, 382, 379, 77, 373, 374, 378, - 77, 375, 384, 377, 76, 381, 682, 380, 682, 76, - 383, 385, 77, 682, 388, 76, 389, 77, 682, 390, + 681, 376, 76, 77, 382, 379, 77, 373, 374, 378, + 77, 375, 384, 377, 76, 381, 681, 380, 681, 76, + 383, 385, 77, 681, 388, 76, 389, 77, 681, 390, 76, 382, 76, 77, 76, 76, 391, 76, 77, 384, - 77, 682, 77, 77, 392, 77, 76, 76, 682, 385, - 682, 76, 388, 389, 77, 77, 390, 396, 394, 77, + 77, 681, 77, 77, 392, 77, 76, 76, 681, 385, + 681, 76, 388, 389, 77, 77, 390, 396, 394, 77, 76, 393, 397, 76, 391, 76, 403, 395, 77, 398, 76, 77, 392, 77, 77, 76, 76, 399, 77, 76, - 682, 682, 76, 77, 77, 396, 394, 77, 393, 397, - 77, 76, 682, 402, 395, 76, 76, 398, 682, 77, + 681, 681, 76, 77, 77, 396, 394, 77, 393, 397, + 77, 76, 681, 402, 395, 76, 76, 398, 681, 77, 400, 76, 401, 77, 77, 399, 76, 405, 76, 77, - 404, 407, 682, 406, 77, 682, 77, 76, 410, 682, - 402, 682, 682, 411, 412, 77, 409, 400, 408, 401, + 404, 407, 681, 406, 77, 681, 77, 76, 410, 681, + 402, 681, 681, 411, 412, 77, 409, 400, 408, 401, - 414, 682, 682, 76, 405, 682, 413, 404, 407, 76, - 406, 77, 76, 415, 682, 682, 410, 77, 76, 76, + 414, 681, 681, 76, 405, 681, 413, 404, 407, 76, + 406, 77, 76, 415, 681, 681, 410, 77, 76, 76, 77, 411, 412, 409, 76, 408, 77, 77, 414, 76, 76, 416, 77, 413, 417, 76, 76, 77, 77, 76, - 419, 415, 682, 77, 77, 682, 76, 77, 76, 76, - 421, 682, 76, 420, 77, 418, 77, 77, 76, 416, + 419, 415, 681, 77, 77, 681, 76, 77, 76, 76, + 421, 681, 76, 420, 77, 418, 77, 77, 76, 416, 77, 417, 76, 76, 76, 76, 77, 422, 419, 424, - 77, 77, 77, 77, 682, 76, 76, 76, 421, 76, - 420, 423, 418, 77, 77, 77, 682, 77, 76, 682, + 77, 77, 77, 77, 681, 76, 76, 76, 421, 76, + 420, 423, 418, 77, 77, 77, 681, 77, 76, 681, 76, 76, 425, 426, 422, 76, 77, 424, 77, 77, - 682, 682, 682, 77, 76, 76, 428, 436, 423, 427, - 430, 337, 77, 77, 429, 77, 76, 433, 682, 425, - 426, 434, 76, 682, 77, 431, 435, 76, 432, 682, - 77, 341, 682, 428, 76, 77, 427, 446, 430, 682, - 76, 429, 77, 682, 682, 433, 440, 447, 77, 434, - 682, 448, 431, 441, 435, 432, 76, 442, 76, 76, - 437, 682, 443, 449, 77, 446, 77, 77, 682, 76, - 682, 76, 444, 440, 447, 76, 445, 77, 448, 77, - 76, 441, 682, 77, 76, 442, 682, 437, 77, 682, - 443, 449, 77, 450, 451, 682, 76, 454, 682, 444, - - 76, 682, 455, 445, 77, 76, 453, 452, 77, 76, - 76, 682, 682, 77, 76, 682, 76, 77, 77, 456, - 450, 451, 77, 76, 77, 454, 457, 682, 682, 458, - 455, 77, 76, 453, 452, 459, 76, 76, 682, 76, - 77, 682, 466, 76, 77, 77, 456, 77, 76, 460, - 77, 77, 76, 76, 457, 682, 77, 458, 76, 76, - 77, 77, 76, 459, 682, 461, 77, 77, 465, 462, + 681, 681, 681, 77, 76, 76, 428, 436, 423, 427, + 430, 337, 77, 77, 429, 77, 76, 433, 681, 425, + 426, 434, 76, 681, 77, 431, 435, 76, 432, 681, + 77, 341, 681, 428, 76, 77, 427, 446, 430, 681, + 76, 429, 77, 681, 681, 433, 440, 447, 77, 434, + 681, 448, 431, 441, 435, 432, 76, 442, 76, 76, + 437, 681, 443, 449, 77, 446, 77, 77, 681, 76, + 681, 76, 444, 440, 447, 76, 445, 77, 448, 77, + 76, 441, 681, 77, 76, 442, 681, 437, 77, 681, + 443, 449, 77, 450, 451, 681, 76, 454, 681, 444, + + 76, 681, 455, 445, 77, 76, 453, 452, 77, 76, + 76, 681, 681, 77, 76, 681, 76, 77, 77, 456, + 450, 451, 77, 76, 77, 454, 457, 681, 681, 458, + 455, 77, 76, 453, 452, 459, 76, 76, 681, 76, + 77, 681, 466, 76, 77, 77, 456, 77, 76, 460, + 77, 77, 76, 76, 457, 681, 77, 458, 76, 76, + 77, 77, 76, 459, 681, 461, 77, 77, 465, 462, 77, 463, 464, 76, 76, 76, 460, 467, 76, 474, - 470, 77, 77, 77, 682, 76, 77, 77, 468, 469, - 682, 471, 461, 77, 76, 465, 462, 76, 463, 464, + 470, 77, 77, 77, 681, 76, 77, 77, 468, 469, + 681, 471, 461, 77, 76, 465, 462, 76, 463, 464, - 473, 472, 77, 76, 467, 77, 76, 682, 470, 76, - 76, 77, 76, 682, 77, 468, 469, 77, 77, 471, - 77, 479, 76, 476, 76, 76, 477, 682, 473, 472, - 77, 475, 77, 77, 682, 478, 682, 76, 76, 76, - 480, 682, 483, 682, 484, 77, 77, 77, 682, 479, - 682, 476, 682, 76, 477, 682, 76, 485, 475, 682, - 486, 77, 682, 478, 77, 76, 682, 480, 76, 489, + 473, 472, 77, 76, 467, 77, 76, 681, 470, 76, + 76, 77, 76, 681, 77, 468, 469, 77, 77, 471, + 77, 479, 76, 476, 76, 76, 477, 681, 473, 472, + 77, 475, 77, 77, 681, 478, 681, 76, 76, 76, + 480, 681, 483, 681, 484, 77, 77, 77, 681, 479, + 681, 476, 681, 76, 477, 681, 76, 485, 475, 681, + 486, 77, 681, 478, 77, 76, 681, 480, 76, 489, 483, 484, 76, 77, 487, 488, 77, 76, 491, 490, - 77, 76, 76, 76, 485, 77, 76, 486, 682, 77, - 77, 77, 76, 682, 77, 76, 489, 682, 682, 682, + 77, 76, 76, 76, 485, 77, 76, 486, 681, 77, + 77, 77, 76, 681, 77, 76, 489, 681, 681, 681, - 77, 487, 488, 77, 682, 492, 491, 490, 494, 682, + 77, 487, 488, 77, 681, 492, 491, 490, 494, 681, 76, 76, 496, 498, 493, 495, 76, 497, 77, 77, - 76, 77, 501, 76, 77, 76, 76, 682, 77, 76, - 77, 77, 492, 77, 77, 76, 494, 77, 76, 682, + 76, 77, 501, 76, 77, 76, 76, 681, 77, 76, + 77, 77, 492, 77, 77, 76, 494, 77, 76, 681, 496, 493, 495, 77, 76, 497, 77, 499, 76, 76, - 76, 500, 77, 682, 502, 76, 77, 77, 77, 504, - 76, 503, 513, 77, 76, 76, 505, 682, 77, 76, - 77, 508, 77, 77, 499, 507, 76, 77, 500, 682, - 506, 502, 682, 76, 77, 76, 509, 504, 503, 76, - 511, 77, 510, 77, 505, 682, 76, 77, 514, 508, - - 76, 512, 76, 507, 77, 682, 76, 506, 77, 76, - 77, 682, 682, 509, 77, 76, 682, 77, 511, 510, - 515, 76, 522, 77, 523, 516, 514, 682, 512, 77, - 76, 517, 520, 76, 76, 518, 76, 519, 77, 682, - 76, 77, 77, 682, 77, 76, 76, 515, 77, 522, - 682, 523, 516, 77, 77, 76, 76, 682, 517, 76, + 76, 500, 77, 681, 502, 76, 77, 77, 77, 504, + 76, 503, 513, 77, 76, 76, 505, 681, 77, 76, + 77, 508, 77, 77, 499, 507, 76, 77, 500, 681, + 506, 502, 681, 76, 77, 76, 509, 504, 503, 76, + 511, 77, 510, 77, 505, 681, 76, 77, 514, 508, + + 76, 512, 76, 507, 77, 681, 76, 506, 77, 76, + 77, 681, 681, 509, 77, 76, 681, 77, 511, 510, + 515, 76, 522, 77, 523, 516, 514, 681, 512, 77, + 76, 517, 520, 76, 76, 518, 76, 519, 77, 681, + 76, 77, 77, 681, 77, 76, 76, 515, 77, 522, + 681, 523, 516, 77, 77, 76, 76, 681, 517, 76, 520, 534, 518, 77, 77, 519, 530, 77, 76, 77, 76, 528, 76, 529, 76, 76, 77, 76, 77, 536, - 77, 537, 77, 77, 682, 77, 682, 77, 682, 77, - 682, 532, 531, 76, 530, 76, 76, 682, 528, 76, + 77, 537, 77, 77, 681, 77, 681, 77, 681, 77, + 681, 532, 531, 76, 530, 76, 76, 681, 528, 76, 529, 77, 76, 77, 77, 533, 76, 77, 76, 535, - 77, 682, 538, 76, 77, 682, 77, 76, 532, 531, - 76, 77, 682, 539, 544, 77, 682, 543, 77, 682, - 542, 682, 533, 76, 540, 541, 535, 76, 76, 547, - 538, 77, 682, 545, 682, 77, 77, 76, 546, 682, - 539, 548, 544, 682, 543, 77, 553, 542, 682, 76, - 682, 540, 541, 555, 77, 682, 547, 77, 550, 551, + 77, 681, 538, 76, 77, 681, 77, 76, 532, 531, + 76, 77, 681, 539, 544, 77, 681, 543, 77, 681, + 542, 681, 533, 76, 540, 541, 535, 76, 76, 547, + 538, 77, 681, 545, 681, 77, 77, 76, 546, 681, + 539, 548, 544, 681, 543, 77, 553, 542, 681, 76, + 681, 540, 541, 555, 77, 681, 547, 77, 550, 551, 545, 77, 76, 76, 549, 546, 76, 558, 548, 76, - 77, 77, 76, 552, 77, 77, 682, 77, 682, 76, - 77, 682, 76, 682, 554, 550, 551, 77, 563, 559, + 77, 77, 76, 552, 77, 77, 681, 77, 681, 76, + 77, 681, 76, 681, 554, 550, 551, 77, 563, 559, 77, 549, 556, 76, 557, 565, 77, 76, 76, 76, - 552, 77, 682, 77, 561, 77, 77, 77, 76, 682, - 560, 554, 562, 682, 682, 76, 77, 559, 76, 556, - 76, 557, 564, 77, 682, 76, 77, 76, 77, 682, - 572, 682, 561, 77, 76, 77, 682, 560, 77, 562, - 682, 682, 77, 682, 568, 76, 567, 76, 566, 570, - 564, 569, 76, 77, 76, 77, 682, 76, 76, 76, - 77, 682, 77, 76, 571, 77, 77, 77, 682, 573, - 76, 77, 568, 567, 583, 566, 570, 682, 77, 569, - 76, 582, 77, 682, 682, 576, 682, 585, 77, 682, + 552, 77, 681, 77, 561, 77, 77, 77, 76, 681, + 560, 554, 562, 681, 681, 76, 77, 559, 76, 556, + 76, 557, 564, 77, 681, 76, 77, 76, 77, 681, + 572, 681, 561, 77, 76, 77, 681, 560, 77, 562, + 681, 681, 77, 681, 568, 76, 567, 76, 566, 570, + 564, 569, 76, 77, 76, 77, 681, 76, 76, 76, + 77, 681, 77, 76, 571, 77, 77, 77, 681, 573, + 76, 77, 568, 567, 583, 566, 570, 681, 77, 569, + 76, 582, 77, 681, 681, 576, 681, 585, 77, 681, 574, 571, 76, 76, 575, 76, 76, 573, 76, 76, 77, 77, 584, 77, 77, 76, 77, 77, 76, 582, - 76, 76, 576, 77, 76, 682, 77, 574, 77, 77, - 682, 575, 77, 589, 76, 682, 76, 76, 588, 76, + 76, 76, 576, 77, 76, 681, 77, 574, 77, 77, + 681, 575, 77, 589, 76, 681, 76, 76, 588, 76, 584, 586, 77, 587, 77, 77, 591, 77, 76, 76, - 682, 76, 682, 682, 76, 590, 77, 77, 592, 77, - 593, 589, 77, 682, 76, 588, 682, 76, 586, 76, - 587, 594, 77, 595, 591, 77, 596, 77, 682, 76, - 682, 598, 590, 76, 76, 76, 592, 77, 593, 77, - 76, 77, 77, 77, 76, 76, 682, 604, 77, 594, + 681, 76, 681, 681, 76, 590, 77, 77, 592, 77, + 593, 589, 77, 681, 76, 588, 681, 76, 586, 76, + 587, 594, 77, 595, 591, 77, 596, 77, 681, 76, + 681, 598, 590, 76, 76, 76, 592, 77, 593, 77, + 76, 77, 77, 77, 76, 76, 681, 604, 77, 594, 76, 595, 77, 77, 596, 77, 597, 76, 77, 600, 76, 76, 599, 611, 76, 77, 76, 76, 77, 77, - 601, 77, 77, 76, 77, 77, 603, 76, 682, 605, - 682, 77, 76, 597, 76, 77, 612, 600, 602, 599, - 77, 682, 77, 76, 616, 682, 682, 601, 606, 614, + 601, 77, 77, 76, 77, 77, 603, 76, 681, 605, + 681, 77, 76, 597, 76, 77, 612, 600, 602, 599, + 77, 681, 77, 76, 616, 681, 681, 601, 606, 614, 76, 77, 76, 603, 615, 76, 618, 605, 77, 76, - 77, 76, 617, 77, 612, 602, 76, 77, 682, 77, - 76, 682, 616, 682, 77, 606, 614, 76, 77, 619, - 682, 615, 76, 76, 618, 77, 76, 621, 622, 617, - 77, 77, 76, 76, 77, 76, 682, 682, 682, 623, - - 77, 77, 682, 77, 620, 624, 619, 682, 682, 682, - 627, 76, 682, 76, 76, 621, 622, 625, 76, 77, - 626, 77, 77, 639, 632, 682, 77, 623, 76, 76, - 640, 682, 636, 624, 76, 76, 77, 77, 627, 638, - 643, 682, 77, 77, 625, 642, 76, 626, 637, 644, - 76, 632, 76, 76, 77, 651, 682, 682, 77, 636, - 77, 77, 76, 77, 641, 645, 76, 638, 643, 682, - 77, 76, 642, 682, 77, 637, 655, 644, 76, 77, - 639, 646, 76, 682, 656, 76, 77, 640, 647, 76, - 77, 641, 645, 77, 76, 682, 76, 77, 76, 648, - - 682, 654, 77, 653, 77, 76, 77, 682, 646, 76, - 76, 76, 655, 77, 76, 647, 658, 77, 77, 77, - 656, 682, 77, 682, 76, 76, 648, 682, 682, 654, - 653, 657, 77, 77, 659, 660, 666, 665, 76, 76, - 76, 664, 76, 682, 658, 76, 77, 77, 77, 76, - 77, 667, 682, 77, 682, 682, 682, 77, 657, 76, - 670, 659, 669, 660, 666, 665, 76, 77, 664, 682, - 668, 337, 682, 76, 77, 76, 76, 671, 76, 667, - 672, 77, 682, 77, 77, 76, 77, 76, 670, 682, - 669, 76, 682, 77, 673, 77, 682, 668, 682, 77, - - 676, 76, 76, 674, 671, 76, 675, 672, 677, 77, - 77, 76, 682, 77, 682, 682, 682, 682, 682, 77, - 682, 673, 682, 682, 681, 682, 682, 679, 676, 682, - 674, 682, 682, 675, 682, 682, 677, 682, 682, 682, - 680, 682, 682, 682, 682, 682, 678, 682, 682, 682, - 682, 682, 681, 682, 679, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 680, 55, 55, + 77, 76, 617, 77, 612, 602, 76, 77, 681, 77, + 76, 681, 616, 681, 77, 606, 614, 76, 77, 619, + 681, 615, 76, 76, 618, 77, 76, 621, 622, 617, + 77, 77, 76, 76, 77, 76, 681, 681, 681, 623, + + 77, 77, 681, 77, 620, 624, 619, 681, 681, 681, + 627, 76, 681, 76, 76, 621, 622, 625, 76, 77, + 626, 77, 77, 638, 632, 681, 77, 623, 76, 76, + 639, 681, 635, 624, 76, 76, 77, 77, 627, 637, + 642, 681, 77, 77, 625, 641, 76, 626, 636, 643, + 76, 632, 76, 76, 77, 650, 681, 681, 77, 635, + 77, 77, 76, 77, 640, 644, 76, 637, 642, 681, + 77, 76, 641, 681, 77, 636, 654, 643, 76, 77, + 638, 645, 76, 681, 655, 76, 77, 639, 646, 76, + 77, 640, 644, 77, 76, 681, 76, 77, 76, 647, + + 681, 653, 77, 652, 77, 76, 77, 681, 645, 76, + 76, 76, 654, 77, 76, 646, 657, 77, 77, 77, + 655, 681, 77, 681, 76, 76, 647, 681, 681, 653, + 652, 656, 77, 77, 658, 659, 665, 664, 76, 76, + 76, 663, 76, 681, 657, 76, 77, 77, 77, 76, + 77, 666, 681, 77, 681, 681, 681, 77, 656, 76, + 669, 658, 668, 659, 665, 664, 76, 77, 663, 681, + 667, 337, 681, 76, 77, 76, 76, 670, 76, 666, + 671, 77, 681, 77, 77, 76, 77, 76, 669, 681, + 668, 76, 681, 77, 672, 77, 681, 667, 681, 77, + + 675, 76, 76, 673, 670, 76, 674, 671, 676, 77, + 77, 76, 681, 77, 681, 681, 681, 681, 681, 77, + 681, 672, 681, 681, 680, 681, 681, 678, 675, 681, + 673, 681, 681, 674, 681, 681, 676, 681, 681, 681, + 679, 681, 681, 681, 681, 681, 677, 681, 681, 681, + 681, 681, 680, 681, 678, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 679, 55, 55, 55, 55, 55, 55, 55, 55, 57, 57, 57, 57, 57, 57, 57, 57, 59, 59, 59, 59, 59, 59, 59, 59, 63, 63, 63, 63, 63, 63, 63, 63, 78, 78, 78, 78, 78, 172, 172, 172, 172, 172, 172, 172, 172, 174, 174, 174, 174, 174, 174, 174, - 174, 178, 178, 682, 178, 178, 178, 178, 178, 179, - 179, 682, 179, 179, 179, 179, 179, 182, 182, 682, + 174, 178, 178, 681, 178, 178, 178, 178, 178, 179, + 179, 681, 179, 179, 179, 179, 179, 182, 182, 681, 182, 182, 182, 182, 182, 183, 183, 184, 184, 311, - 682, 311, 311, 311, 438, 438, 682, 438, 438, 438, - 438, 438, 481, 481, 682, 481, 481, 481, 481, 481, - 613, 682, 682, 682, 682, 613, 613, 635, 682, 635, - 635, 635, 635, 652, 652, 663, 682, 682, 663, 663, - 663, 9, 682, 682, 682, 682, 682, 682, 682, 682, - - 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 682 + 681, 311, 311, 311, 438, 438, 681, 438, 438, 438, + 438, 438, 481, 481, 681, 481, 481, 481, 481, 481, + 613, 681, 681, 681, 681, 613, 613, 634, 634, 634, + 634, 651, 651, 662, 662, 662, 9, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681 } ; -static yyconst flex_int16_t yy_chk[2870] = +static yyconst flex_int16_t yy_chk[2865] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1112,11 +1110,11 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 14, 2, 14, 2, 4, 4, 17, 17, 19, 443, - 19, 19, 2, 2, 20, 663, 20, 20, 17, 22, + 19, 19, 2, 2, 20, 649, 20, 20, 17, 22, 22, 30, 19, 33, 36, 63, 34, 63, 20, 30, - 652, 33, 36, 650, 34, 56, 56, 443, 64, 30, - 64, 19, 50, 30, 649, 33, 17, 30, 34, 585, + 648, 33, 36, 634, 34, 56, 56, 443, 64, 30, + 64, 19, 50, 30, 613, 33, 17, 30, 34, 585, 19, 48, 33, 30, 447, 33, 20, 50, 50, 48, 171, 171, 35, 482, 78, 439, 46, 30, 19, 27, 35, 30, 78, 33, 46, 30, 34, 27, 386, 33, @@ -1141,8 +1139,8 @@ 109, 80, 83, 29, 18, 579, 85, 29, 82, 90, 29, 29, 71, 29, 83, 446, 29, 90, 85, 89, 83, 86, 29, 31, 109, 87, 185, 89, 92, 86, - 187, 31, 88, 87, 185, 16, 92, 639, 187, 91, - 12, 89, 83, 86, 639, 90, 85, 91, 83, 93, + 187, 31, 88, 87, 185, 16, 92, 638, 187, 91, + 12, 89, 83, 86, 638, 90, 85, 91, 83, 93, 86, 109, 31, 580, 31, 31, 87, 93, 31, 88, 92, 31, 87, 92, 31, 91, 96, 97, 136, 89, 11, 86, 90, 9, 96, 97, 136, 86, 95, 31, @@ -1183,15 +1181,15 @@ 142, 0, 43, 134, 43, 141, 133, 138, 43, 131, 43, 132, 526, 141, 43, 43, 527, 134, 43, 43, 139, 43, 137, 43, 44, 127, 127, 142, 44, 141, - 137, 44, 44, 0, 138, 143, 141, 613, 44, 132, - 526, 44, 145, 143, 527, 134, 144, 139, 137, 613, + 137, 44, 44, 0, 138, 143, 141, 0, 44, 132, + 526, 44, 145, 143, 527, 134, 144, 139, 137, 0, 145, 0, 44, 148, 144, 607, 44, 141, 170, 44, 44, 148, 147, 141, 145, 44, 143, 149, 44, 47, 147, 151, 146, 170, 170, 149, 137, 47, 153, 151, - 146, 144, 148, 607, 147, 0, 153, 47, 635, 0, + 146, 144, 148, 607, 147, 0, 153, 47, 0, 0, 151, 47, 145, 143, 47, 47, 146, 154, 150, 169, - 635, 0, 149, 146, 47, 154, 150, 169, 144, 148, + 0, 0, 149, 146, 47, 154, 150, 169, 144, 148, 608, 0, 147, 152, 153, 47, 150, 155, 151, 47, 150, 152, 47, 47, 146, 155, 609, 156, 154, 149, 146, 47, 140, 150, 169, 156, 0, 159, 608, 152, @@ -1373,57 +1371,57 @@ 617, 0, 614, 602, 621, 622, 617, 620, 606, 616, 619, 0, 621, 622, 603, 618, 624, 603, 615, 620, 623, 612, 625, 626, 624, 632, 0, 0, 623, 614, - 625, 626, 627, 632, 617, 621, 636, 616, 619, 0, - 627, 637, 618, 0, 636, 615, 640, 620, 638, 637, - 641, 623, 642, 0, 640, 641, 638, 641, 626, 643, - 642, 617, 621, 641, 645, 0, 644, 643, 646, 627, - - 0, 638, 645, 637, 644, 647, 646, 0, 623, 648, - 653, 654, 655, 647, 657, 626, 645, 648, 653, 654, - 655, 0, 657, 0, 658, 659, 627, 0, 0, 638, - 637, 644, 658, 659, 646, 648, 657, 654, 660, 664, - 665, 653, 666, 0, 645, 667, 660, 664, 665, 668, - 666, 659, 0, 667, 0, 0, 0, 668, 644, 669, - 666, 646, 665, 648, 657, 654, 670, 669, 653, 0, - 660, 672, 0, 673, 670, 671, 672, 667, 674, 659, - 668, 673, 0, 671, 672, 675, 674, 676, 666, 0, - 665, 678, 0, 675, 669, 676, 0, 660, 0, 678, - - 674, 677, 679, 670, 667, 680, 671, 668, 676, 677, - 679, 681, 0, 680, 0, 0, 0, 0, 0, 681, - 0, 669, 0, 0, 680, 0, 0, 678, 674, 0, - 670, 0, 0, 671, 0, 0, 676, 0, 0, 0, - 679, 0, 0, 0, 0, 0, 677, 0, 0, 0, - 0, 0, 680, 0, 678, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 679, 683, 683, - 683, 683, 683, 683, 683, 683, 684, 684, 684, 684, - 684, 684, 684, 684, 685, 685, 685, 685, 685, 685, - 685, 685, 686, 686, 686, 686, 686, 686, 686, 686, - - 687, 687, 687, 687, 687, 688, 688, 688, 688, 688, - 688, 688, 688, 689, 689, 689, 689, 689, 689, 689, - 689, 690, 690, 0, 690, 690, 690, 690, 690, 691, - 691, 0, 691, 691, 691, 691, 691, 692, 692, 0, - 692, 692, 692, 692, 692, 693, 693, 694, 694, 695, - 0, 695, 695, 695, 696, 696, 0, 696, 696, 696, - 696, 696, 697, 697, 0, 697, 697, 697, 697, 697, - 698, 0, 0, 0, 0, 698, 698, 699, 0, 699, - 699, 699, 699, 700, 700, 701, 0, 0, 701, 701, - 701, 682, 682, 682, 682, 682, 682, 682, 682, 682, - - 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 682 + 625, 626, 627, 632, 617, 621, 635, 616, 619, 0, + 627, 636, 618, 0, 635, 615, 639, 620, 637, 636, + 640, 623, 641, 0, 639, 640, 637, 640, 626, 642, + 641, 617, 621, 640, 644, 0, 643, 642, 645, 627, + + 0, 637, 644, 636, 643, 646, 645, 0, 623, 647, + 652, 653, 654, 646, 656, 626, 644, 647, 652, 653, + 654, 0, 656, 0, 657, 658, 627, 0, 0, 637, + 636, 643, 657, 658, 645, 647, 656, 653, 659, 663, + 664, 652, 665, 0, 644, 666, 659, 663, 664, 667, + 665, 658, 0, 666, 0, 0, 0, 667, 643, 668, + 665, 645, 664, 647, 656, 653, 669, 668, 652, 0, + 659, 671, 0, 672, 669, 670, 671, 666, 673, 658, + 667, 672, 0, 670, 671, 674, 673, 675, 665, 0, + 664, 677, 0, 674, 668, 675, 0, 659, 0, 677, + + 673, 676, 678, 669, 666, 679, 670, 667, 675, 676, + 678, 680, 0, 679, 0, 0, 0, 0, 0, 680, + 0, 668, 0, 0, 679, 0, 0, 677, 673, 0, + 669, 0, 0, 670, 0, 0, 675, 0, 0, 0, + 678, 0, 0, 0, 0, 0, 676, 0, 0, 0, + 0, 0, 679, 0, 677, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 678, 682, 682, + 682, 682, 682, 682, 682, 682, 683, 683, 683, 683, + 683, 683, 683, 683, 684, 684, 684, 684, 684, 684, + 684, 684, 685, 685, 685, 685, 685, 685, 685, 685, + + 686, 686, 686, 686, 686, 687, 687, 687, 687, 687, + 687, 687, 687, 688, 688, 688, 688, 688, 688, 688, + 688, 689, 689, 0, 689, 689, 689, 689, 689, 690, + 690, 0, 690, 690, 690, 690, 690, 691, 691, 0, + 691, 691, 691, 691, 691, 692, 692, 693, 693, 694, + 0, 694, 694, 694, 695, 695, 0, 695, 695, 695, + 695, 695, 696, 696, 0, 696, 696, 696, 696, 696, + 697, 0, 0, 0, 0, 697, 697, 698, 698, 698, + 698, 699, 699, 700, 700, 700, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681 } ; /* Table of booleans, true if rule could match eol. */ static yyconst flex_int32_t yy_rule_can_match_eol[213] = { 0, -0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, +0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1758,14 +1756,14 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 683 ) + if ( yy_current_state >= 682 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } - while ( yy_base[yy_current_state] != 2792 ); + while ( yy_base[yy_current_state] != 2787 ); yy_find_action: yy_current_state = *--(yy_state_ptr); @@ -1827,9 +1825,9 @@ case YY_STATE_EOF(PASTLNO): case YY_STATE_EOF(PASTIMPORT): { - if (infolevel>=DEBUG) { - sprintf(string,"closing file '%s'",currlib->short_name); - error(DEBUG,string); + if (severity_threshold <= sDEBUG) { + sprintf(string,"Closing file '%s'",currlib->short_name); + error(sDEBUG,string); } if (--include_depth<0) { return tEOPROG; @@ -1838,6 +1836,7 @@ yy_delete_buffer(YY_CURRENT_BUFFER); yy_switch_to_buffer(include_stack[include_depth]); } + report_if_missing(sERROR,"Premature end of file",TRUE); leave_lib(); return tSEP; } @@ -1881,7 +1880,7 @@ YY_BREAK case 8: YY_RULE_SETUP -{if (fi_pending && check_compat) error(WARNING,"short-if has changed in version 2.71");return tSEP;} +{if (fi_pending && check_compat) error(sWARNING,"Short if has changed in version 2.71");return tSEP;} YY_BREAK case 9: YY_RULE_SETUP @@ -1901,7 +1900,6 @@ {yymore();} YY_BREAK case 13: -/* rule 13 can match eol */ YY_RULE_SETUP {BEGIN(PASTIMPORT);import_lib(my_strdup(yytext+7));return tIMPORT;} YY_BREAK @@ -3006,7 +3004,7 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 683 ) + if ( yy_current_state >= 682 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; @@ -3029,11 +3027,11 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 683 ) + if ( yy_current_state >= 682 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; - yy_is_jam = (yy_current_state == 682); + yy_is_jam = (yy_current_state == 681); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; @@ -3766,7 +3764,7 @@ /* This can only occur in bound programs; void all further import-statements */ if (!strcmp(name,"__END_OF_ALL_IMPORTS")) { - error(DEBUG,"Encountered special import __END_OF_ALL_IMPORTS"); + error(sDEBUG,"Encountered special import __END_OF_ALL_IMPORTS"); end_of_all_imports=TRUE; } @@ -3774,7 +3772,7 @@ /* This can only occur in bound programs, close currently imported library */ if (!strcmp(name,"__END_OF_CURRENT_IMPORT")) { - error(DEBUG,"Encountered special import __END_OF_CURRENT_IMPORT"); + error(sDEBUG,"Encountered special import __END_OF_CURRENT_IMPORT"); include_depth--; leave_lib(); ignore_nested_imports=FALSE; @@ -3783,7 +3781,7 @@ /* This can only occur in bound programs, ignore nested import-statement */ if (!strcmp(name,"__IGNORE_NESTED_IMPORTS")) { - error(DEBUG,"Encountered special import __IGNORE_NESTED_IMPORTS"); + error(sDEBUG,"Encountered special import __IGNORE_NESTED_IMPORTS"); ignore_nested_imports=TRUE; } @@ -3793,7 +3791,7 @@ inlib=TRUE; if (include_depth>=MAX_INCLUDE_DEPTH) { sprintf(string,"Could not import '%s': nested too deep (%d)",name,include_depth); - error(ERROR,string); + error(sERROR,string); return FALSE; } @@ -3809,22 +3807,22 @@ library_chain[library_chain_length++]=library_stack[include_depth]; if (library_chain_length>=MAX_INCLUDE_NUMBER) { sprintf(string,"Cannot import more than %d libraries",MAX_INCLUDE_NUMBER); - error(ERROR,string); + error(sERROR,string); return FALSE; } if (!library_stack[include_depth]) { sprintf(string,"library '%s' has already been imported",full); - error(ERROR,string); + error(sERROR,string); return FALSE; } - if (infolevel>=NOTE) { + if (severity_threshold <= sNOTE) { if (isbound) { sprintf(string,"importing library '%s'",name); } else { sprintf(string,"importing from file '%s'",full); } - error(NOTE,string); + error(sNOTE,string); } currlib=library_stack[include_depth]; /* switch late because error() uses currlib */ return TRUE; @@ -3847,12 +3845,12 @@ name=unquoted; if (strchr(name,'.')) { sprintf(string,"library name '%s' contains '.'",name); - error(ERROR,string); + error(sERROR,string); return NULL; } if (!strcmp(name,"main")) { if (is_bound) return NULL; - error(ERROR,"invalid library name 'main'"); + error(sERROR,"invalid library name 'main'"); return NULL; } @@ -3902,16 +3900,16 @@ if (lib) return lib; sprintf(string,"could not open library '%s': not in current workingdir as '%s', not in directory of main file as '%s', not in library path as '%s'",name,full_wdir,full_main,full_global); - error(ERROR,string); + error(sERROR,string); return NULL; } void leave_lib(void) /* processing, when end of library is found */ { if (include_depth<0) return; - if (infolevel>=DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf(string,"End of library '%s', continue with '%s', include depth is now %d",currlib->short_name,library_stack[include_depth]->short_name,include_depth); - error(DEBUG,string); + error(sDEBUG,string); } yylineno=currlib->yylineno_at_start; currlib=library_stack[include_depth]; diff -Nru yabasic-2.82.0/flow.c yabasic-2.82.1/flow.c --- yabasic-2.82.0/flow.c 2019-02-16 21:47:45.000000000 +0000 +++ yabasic-2.82.1/flow.c 2019-03-10 17:06:10.000000000 +0000 @@ -72,9 +72,9 @@ sprintf (string, "subroutine returns %s but should return %s", (is == ftSTRING) ? "a string" : "a number", (should == ftSTRING) ? "a string" : "a number"); - error (ERROR, string); + error (sERROR, string); } - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { s = stackhead->prev; if (s->type == stNUMBER) { sprintf (string, "subroutine returns number %g", s->value); @@ -84,7 +84,7 @@ else sprintf (string, "subroutine returns something strange (%d)", s->type); - error (DEBUG, string); + error (sDEBUG, string); } } @@ -105,7 +105,7 @@ } else if (keep->type==stNUMBER) { kept_value=keep->value; } else { - error (FATAL, "expecting only string or number on stack"); + error (sFATAL, "expecting only string or number on stack"); } } @@ -185,12 +185,12 @@ address = pop (stANY); if (cmd->type == cRETURN_FROM_CALL) { if (address->type != stRET_ADDR_CALL) { - error (FATAL, "RETURN from a subroutine without CALL"); + error (sFATAL, "RETURN from a subroutine without CALL"); return; } } else { /* cRETURN_FROM_GOSUB */ if (address->type != stRET_ADDR) { - error (FATAL, "RETURN without GOSUB"); + error (sFATAL, "RETURN without GOSUB"); return; } } @@ -206,7 +206,7 @@ struct command *cmd; if (!inlib) { - error(DEBUG, "not in library, will not create link to subroutine"); + error(sDEBUG, "not in library, will not create link to subroutine"); return; } dot = strchr (label, '.'); @@ -216,7 +216,7 @@ /* check, if label is duplicate */ if (search_label (global, srmSUBR | srmLINK | srmLABEL)) { sprintf (string, "duplicate subroutine '%s'", strip (global)); - error (ERROR, string); + error (sERROR, string); return; } @@ -248,9 +248,9 @@ cmd->type = cCALL; cmd->pointer = cmd->symname; cmd->symname = NULL; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf(errorstring, "converting '%s' to '%s'",explanation[cFUNCTION_OR_ARRAY],explanation[cFUNCTION]); - error(DEBUG, errorstring); + error(sDEBUG, errorstring); } } else { if (cmd->type == cFUNCTION_OR_ARRAY) { @@ -260,9 +260,9 @@ } cmd->type = cDOARRAY; cmd->args = -1; - if (infolevel >= DEBUG) { + if ( severity_threshold <= sDEBUG) { sprintf(errorstring, "converting '%s' to '%s'",explanation[cFUNCTION_OR_ARRAY],explanation[cDOARRAY]); - error(DEBUG, errorstring); + error(sDEBUG, errorstring); } } } @@ -285,7 +285,7 @@ sprintf (string, "local variable '%s' already defined within this subroutine", strip (cmd->symname)); - error (ERROR, string); + error (sERROR, string); return; } get_sym (cmd->symname, cmd->args, amADD_LOCAL); @@ -327,12 +327,12 @@ char *dot; dot = strchr (cmd->pointer, '.'); if (first && !short_dump) { - error_without_position (DUMP, "Executing in:"); + error_without_position (sDUMP, "Executing in:"); } sprintf (dumpbuffer, "sub %s() called in %s,%d", dot ? (dot + 1) : (char *) cmd->pointer, cmd->lib->long_name, cmd->line); - error_without_position (DUMP, dumpbuffer); + error_without_position (sDUMP, dumpbuffer); first = FALSE; } } @@ -340,11 +340,11 @@ } while (st && st != stackroot); if (first && !short_dump) { if (!short_dump) { - error_without_position (DUMP, "Executing in:"); + error_without_position (sDUMP, "Executing in:"); } } if (!short_dump) { - error_without_position (DUMP, "main program"); + error_without_position (sDUMP, "main program"); } return; @@ -403,7 +403,7 @@ void push_switch_id(void) /* generate a new switch id on top of stack */ { - if (switch_nesting>=100) error(FATAL, "more than 100 nested switch statements"); + if (switch_nesting>=100) error(sFATAL, "more than 100 nested switch statements"); switch_nesting++; max_switch_id++; @@ -414,7 +414,7 @@ void pop_switch_id (void) /* pop last switch_id */ { - if (switch_nesting<=0) error(FATAL, "no more switch ids to pop"); + if (switch_nesting<=0) error(sFATAL, "no more switch ids to pop"); switch_nesting--; } @@ -529,7 +529,7 @@ if (strchr (cmd->pointer, '@')) { strcat (string, " (not in this sub)"); } - error (ERROR, string); + error (sERROR, string); } } @@ -596,11 +596,11 @@ /* okay: move out of single switch statement */ return 1; } else if (from->switch_state->id == 0 && to->switch_state->id != 0) { - error (ERROR, "GOTO into a switch-statement"); + error (sERROR, "GOTO into a switch-statement"); } else if (from->switch_state->nesting != 0 && to->switch_state->nesting == 0) { - error (ERROR, "GOTO out of multiple switch-statements"); + error (sERROR, "GOTO out of multiple switch-statements"); } else { - error (ERROR, "GOTO between switch-statements"); + error (sERROR, "GOTO between switch-statements"); } return 0; } @@ -615,7 +615,7 @@ if (search_label (label, srmSUBR | srmLINK | srmLABEL)) { sprintf (string, "duplicate %s '%s'", (type == cLABEL) ? "label" : "subroutine", strip (label)); - error (ERROR, string); + error (sERROR, string); return; } @@ -632,10 +632,10 @@ { if (pop(stNUMBER)->value != 0) { current = current->next; /* skip one command */ - if (infolevel >= DEBUG) std_diag("skipping", current->type, current->symname, current->diag); + if (severity_threshold <= sDEBUG) std_diag("skipping", current->type, current->symname, current->diag); } else { - if (infolevel >= DEBUG) error(DEBUG, "(no command skipped)"); + if (severity_threshold <= sDEBUG) error(sDEBUG, "(no command skipped)"); } } @@ -699,12 +699,12 @@ { if (cmd->prev->type != cPOP_MULTI) { sprintf(string, "while trying to load pop_multi; preceding command is rather '%s'", explanation[cmd->prev->type]); - error(FATAL, string); + error(sFATAL, string); } cmd->prev->tag = to_pop; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf(string, "loading previous pop_multi-command with %d", to_pop); - error(DEBUG, string); + error(sDEBUG, string); } /* and execute it for the first time */ @@ -719,7 +719,7 @@ if (depth > 3 || depth < 1) { sprintf(string, "invalid number of levels to break: %d; only 1,2 or 3 are allowed",depth); - error(ERROR,string); + error(sERROR,string); } cmd = add_command (cBREAK_MULTI, NULL, NULL); @@ -759,13 +759,13 @@ if (!curr) { curr = cmd; sprintf(errorstring,"break has left program (loop_nesting=%d, switch_nesting=%d)",loop_nesting,switch_nesting); - error (ERROR, errorstring); + error (sERROR, errorstring); } } cmd->type = cQGOTO; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf(errorstring, "converting '%s' to '%s'",explanation[cBREAK_MULTI],explanation[cQGOTO]); - error (DEBUG, errorstring); + error (sDEBUG, errorstring); } load_pop_multi(cmd, to_pop); cmd->jump = current = curr; @@ -798,13 +798,13 @@ if (!curr) { curr = cmd; sprintf(string,"continue has left program (loop_nesting=%d)",loop_nesting); - error (ERROR, string); + error (sERROR, string); } } cmd->type = cQGOTO; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf( errorstring, "converting '%s' to '%s'",explanation[cCONTINUE],explanation[cQGOTO]); - error (DEBUG, errorstring); + error (sDEBUG, errorstring); } load_pop_multi(cmd, to_pop); cmd->jump = current = curr; @@ -836,13 +836,13 @@ if (!curr) { curr = cmd; sprintf(errorstring,"search for next case has left program (loop_nesting=%d, switch_nesting=%d)",loop_nesting,switch_nesting); - error (ERROR, errorstring); + error (sERROR, errorstring); } } cmd->type = cQGOTO; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf(errorstring,"converting '%s' to '%s'",explanation[cNEXT_CASE],explanation[cQGOTO]); - error (DEBUG, errorstring); + error (sDEBUG, errorstring); } cmd->jump = current = curr; } diff -Nru yabasic-2.82.0/function.c yabasic-2.82.1/function.c --- yabasic-2.82.0/function.c 2019-02-10 18:03:58.000000000 +0000 +++ yabasic-2.82.1/function.c 2019-03-10 17:06:10.000000000 +0000 @@ -77,12 +77,12 @@ sym = get_sym (s->pointer, syARRAY, amSEARCH); if (!sym || !sym->pointer) { sprintf (string, "array '%s()' is not defined", strip (s->pointer)); - error (ERROR, string); + error (sERROR, string); goto token_done; } ar = sym->pointer; if (ar->dimension > 1) { - error (ERROR, "only one dimensional arrays allowed"); + error (sERROR, "only one dimensional arrays allowed"); goto token_done; } @@ -225,9 +225,9 @@ { int res; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf (string, "globbing '%s' on '%s'", str, pat); - error (DEBUG, string); + error (sDEBUG, string); } if (*pat == '\0' && *str == '\0') { return TRUE; @@ -458,7 +458,7 @@ pointer = my_strdup (""); sprintf (string, "'%s' is not a valid format", (char *) a2->pointer); - error (ERROR, string); + error (sERROR, string); break; } pointer = my_strdup (string); @@ -622,7 +622,7 @@ i = (int) floor (a1->value); if (i > 255 || i < 0) { sprintf (string, "can't convert %g to character", a1->value); - error (ERROR, string); + error (sERROR, string); return; } pointer[1] = '\0'; @@ -825,9 +825,9 @@ if (badstream (i, 0)) { return; } - if (!(stream_modes[i] & (stmREAD | stmWRITE))) { + if (!(stream_modes[i] & (mREAD | mWRITE))) { sprintf (string, "stream %d not opened", i); - error (ERROR, string); + error (sERROR, string); value = 0; } else { value = ftell (streams[i]); @@ -835,7 +835,7 @@ result = stNUMBER; break; default: - error (ERROR, "function called but not implemented"); + error (sERROR, "function called but not implemented"); return; } @@ -863,7 +863,7 @@ if (tcsetpgrp(STDIN_FILENO, getpid())) { sprintf(string,"could not get control of terminal: %s", my_strerror(errno)); - error (ERROR,string); + error (sERROR,string); return ret; } reset_prog_mode (); @@ -898,7 +898,7 @@ if (!CreateProcess (NULL, string, &prosec, &thrsec, TRUE, 0, NULL, NULL, &start, &proc)) { sprintf (string, "couldn't execute '%s'", cmd); - error (ERROR, string); + error (sERROR, string); return -1; } WaitForSingleObject (proc.hProcess, INFINITE); @@ -988,7 +988,7 @@ p = popen (cmd, "r"); if (p == NULL) { sprintf (string, "couldn't execute '%s'", cmd); - error (ERROR, string); + error (sERROR, string); return my_strdup (""); } do { @@ -1031,7 +1031,7 @@ if (!CreateProcess (NULL, string, &prosec, &thrsec, TRUE, 0, NULL, NULL, &start, &proc)) { sprintf (string, "couldn't execute '%s'", cmd); - error (ERROR, string); + error (sERROR, string); return my_strdup (""); } CloseHandle (pipewrite); @@ -1143,7 +1143,7 @@ if (base != 2 && base != 16) { sprintf (string, "Cannot convert base-%d numbers", base); - error (ERROR, string); + error (sERROR, string); return 0.; } dec = 0; @@ -1153,7 +1153,7 @@ found = strchr (digits, tolower (hex[i])); if (!found || found - digits >= base) { sprintf (string, "Not a base-%d number: '%s'", base, hex); - error (ERROR, string); + error (sERROR, string); return 0.; } dec += found - digits; @@ -1430,27 +1430,27 @@ c = tolower ((int) *string_arg); switch (c) { case 'd': - infolevel = DEBUG; + severity_threshold = sDEBUG; break; case 'n': - infolevel = NOTE; + severity_threshold = sNOTE; break; case 'w': - infolevel = WARNING; + severity_threshold = sWARNING; break; case 'e': - infolevel = ERROR; + severity_threshold = sERROR; break; case 'f': - infolevel = FATAL; + severity_threshold = sFATAL; break; default: - error (ERROR, "invalid infolevel"); + error (sERROR, "invalid infolevel"); return; } - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf (string, "switching infolevel to '%c'", c); - error (DEBUG, string); + error (sDEBUG, string); } } else if (!strcmp (dest, "stdout") && string_arg) { fputs (string_arg, stdout); @@ -1465,13 +1465,13 @@ } if (count != (int) double_arg) { sprintf (string, "assertion failed for number of entries on stack; expected = %d, actual = %d",(int) double_arg,count); - error (FATAL, string); + error (sFATAL, string); } } else if (dest[0] == '#') { - error (ERROR, "don't use quotes when poking into file"); + error (sERROR, "don't use quotes when poking into file"); } else { sprintf(string,"invalid poke: '%s'",dest); - error (ERROR, string); + error (sERROR, string); } return; } @@ -1495,16 +1495,16 @@ return; } - if (!(stream_modes[stream] & stmWRITE)) { + if (!(stream_modes[stream] & mWRITE)) { sprintf (string, "Stream %d not open for writing", stream); - error (ERROR, string); + error (sERROR, string); return; } if (sarg) { fputs (sarg, streams[stream]); } else { if (darg < 0 || darg > 255) { - error (ERROR, "stream poke out of byte range (0..255)"); + error (sERROR, "stream poke out of byte range (0..255)"); return; } fputc ((int) darg, streams[stream]); @@ -1545,11 +1545,11 @@ } else if (!strcmp (dest, "millisrunning")) { return current_millis() - millis_compilation_start; } else if (dest[0] == '#') { - error (ERROR, "don't use quotes when peeking into a file"); + error (sERROR, "don't use quotes when peeking into a file"); return 0; } - error (ERROR, "invalid peek"); + error (sERROR, "invalid peek"); return 0; } @@ -1560,9 +1560,9 @@ if (stream && badstream (stream, 0)) { return 0; } - if (stream && !(stream_modes[stream] & stmREAD)) { + if (stream && !(stream_modes[stream] & mREAD)) { sprintf (string, "stream %d not open for reading", stream); - error (ERROR, string); + error (sERROR, string); return 0; } return fgetc (stream ? streams[stream] : stdin); @@ -1578,15 +1578,15 @@ *s = tolower ((int) *s); } if (!strcmp (dest, "infolevel")) { - if (infolevel == DEBUG) { + if (severity_threshold == sDEBUG) { return my_strdup ("debug"); - } else if (infolevel == NOTE) { + } else if (severity_threshold == sNOTE) { return my_strdup ("note"); - } else if (infolevel == WARNING) { + } else if (severity_threshold == sWARNING) { return my_strdup ("warning"); - } else if (infolevel == ERROR) { + } else if (severity_threshold == sERROR) { return my_strdup ("error"); - } else if (infolevel == FATAL) { + } else if (severity_threshold == sFATAL) { return my_strdup ("fatal"); } else { return my_strdup ("unknown"); @@ -1625,7 +1625,7 @@ } return my_strdup (s); } else { - error (ERROR, "invalid peek"); + error (sERROR, "invalid peek"); } return my_strdup (""); } @@ -1642,7 +1642,7 @@ if (!strcmp (dest, "env") || !strcmp (dest, "environment")) { return my_strdup (getenv (cont)); } else { - error (ERROR, "invalid peek"); + error (sERROR, "invalid peek"); } return my_strdup (""); } @@ -1733,7 +1733,7 @@ /* did not find label */ sprintf (string, "can't find label '%s'", (char *) cmd->pointer); - error (ERROR, string); + error (sERROR, string); return; } } @@ -1809,11 +1809,11 @@ *datapointer = (*datapointer)->nextassoc; } if (!*datapointer) { - error (ERROR, "run out of data items"); + error (sERROR, "run out of data items"); return; } if (type != (*datapointer)->tag) { - error (ERROR, "type of READ and DATA don't match"); + error (sERROR, "type of READ and DATA don't match"); return; } read = push (); @@ -1980,7 +1980,7 @@ r = (first->value == second->value) ? 1. : 0.; } } else { - error (ERROR, + error (sERROR, "mixing strings and numbers in a single switch statement is not allowed"); } @@ -2006,7 +2006,7 @@ if ((type->type == cORSHORT && is != 0) || (type->type == cANDSHORT && is == 0)) { result = push (); - error (DEBUG, "logical shortcut taken"); + error (sDEBUG, "logical shortcut taken"); result->type = stNUMBER; result->value = is; } else { diff -Nru yabasic-2.82.0/graphic.c yabasic-2.82.1/graphic.c --- yabasic-2.82.0/graphic.c 2019-01-27 07:03:29.000000000 +0000 +++ yabasic-2.82.1/graphic.c 2019-03-10 17:06:10.000000000 +0000 @@ -174,7 +174,7 @@ #endif if (winopened) { - error (WARNING, "Window already open"); + error (sWARNING, "Window already open"); return; } @@ -185,13 +185,13 @@ winheight = (int) pop (stNUMBER)->value; if (winheight < 1) { - error (ERROR, "winheight less than 1 pixel"); + error (sERROR, "winheight less than 1 pixel"); return; } winwidth = (int) pop (stNUMBER)->value; if (winwidth < 1) { - error (ERROR, "winwidth less than 1 pixel"); + error (sERROR, "winwidth less than 1 pixel"); return; } @@ -218,7 +218,7 @@ CWColormap, &attrib); if (window == None) { - error (ERROR, "Could not create window"); + error (sERROR, "Could not create window"); return; } @@ -246,7 +246,7 @@ XCreatePixmap (display, window, winwidth, winheight, attributes.depth); if (!backbit) { - error (ERROR, "couldn't create backing pixmap"); + error (sERROR, "couldn't create backing pixmap"); return; } XFillRectangle (display, window, rgc, 0, 0, winwidth, winheight); @@ -280,7 +280,7 @@ } } } else if (backpid == -1) { - error (ERROR, "couldn't fork child"); + error (sERROR, "couldn't fork child"); return; } @@ -298,7 +298,7 @@ wthandle = CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE) winthread, 0, 0, (LPDWORD) & wtid); if (wthandle == NULL) { - error (ERROR, "can't create thread for window"); + error (sERROR, "can't create thread for window"); return; } @@ -697,7 +697,7 @@ display = XOpenDisplay (displayname); if (display == NULL) { sprintf (string, "could not open display: %s", my_strerror (errno)); - error (ERROR, string); + error (sERROR, string); return FALSE; } @@ -716,7 +716,7 @@ TrueColor, &visualinfo) && !XMatchVisualInfo (display, DefaultScreen (display), 8, TrueColor, &visualinfo)) { - error (ERROR, "Could not get any TrueColor visual"); + error (sERROR, "Could not get any TrueColor visual"); return FALSE; } @@ -737,11 +737,11 @@ for (bbits_count = 0; bbits_max & (1 << bbits_count); bbits_count++); sprintf (string, "Creating a %d bit True Color map", visualinfo.depth); - error (NOTE, string); + error (sNOTE, string); sprintf (string, "with %d, %d and %d bits for red, green and blue respectively", rbits_count, gbits_count, bbits_count); - error (NOTE, string); + error (sNOTE, string); /* create the colormap */ colormap = @@ -759,7 +759,7 @@ (display, colormap, foreground, &exact_match, &best_match)) { sprintf (string, "Could not find foreground color '%s'\n", background); - error (ERROR, string); + error (sERROR, string); return FALSE; } forepixel = @@ -776,7 +776,7 @@ (display, colormap, background, &exact_match, &best_match)) { sprintf (string, "Could not find background color '%s'\n", background); - error (ERROR, string); + error (sERROR, string); return FALSE; } backpixel = @@ -836,7 +836,7 @@ sprintf (string, "command line option -foreground must be three numbers between 0 and 255, separated by commas (not '%s')", foreground); - error (ERROR, string); + error (sERROR, string); return FALSE; } forepixel = RGB (r, g, b); @@ -851,7 +851,7 @@ sprintf (string, "command line option -background must be three numbers between 0 and 255, separated by commas (not '%s')", background); - error (ERROR, string); + error (sERROR, string); return FALSE; } backpixel = RGB (r, g, b); @@ -890,10 +890,10 @@ if (!myfont) { sprintf (string, "could not load font '%s', trying 'fixed' instead", fontname); - error (WARNING, string); + error (sWARNING, string); myfont = XLoadQueryFont (display, "fixed"); if (!myfont) { - error (ERROR, "could not get it"); + error (sERROR, "could not get it"); return FALSE; } } @@ -901,7 +901,7 @@ xgcvalues.font = myfont->fid; if (!XChangeGC (display, gc, GCFont, &xgcvalues)) { sprintf (string, "Could not change font to '%s'", fontname); - error (ERROR, string); + error (sERROR, string); return FALSE; } firsttext = TRUE; @@ -951,7 +951,7 @@ else { sprintf (string, "Don't know font '%s' using 'swiss' instead", fontname); - error (WARNING, string); + error (sWARNING, string); f = FF_SWISS; } logfont.lfHeight = -fontheight; @@ -971,7 +971,7 @@ myfont = CreateFontIndirect (&logfont); if (myfont == NULL) { sprintf (string, "Could not create font '%s' for screen", fontname); - error (ERROR, string); + error (sERROR, string); return FALSE; } my_free (family); @@ -985,11 +985,11 @@ printerfont = CreateFontIndirect (&logfont); if (printerfont == NULL) { sprintf (string, "Could not create font for printer"); - error (ERROR, string); + error (sERROR, string); return FALSE; } if (!SelectObject (printer, printerfont)) { - error (ERROR, "could not select printerfont"); + error (sERROR, "could not select printerfont"); } } @@ -1037,7 +1037,7 @@ transform (&x, &y); clear = cmd->tag & dmCLEAR; if (!winopened) { - error (ERROR, "Got no window to draw"); + error (sERROR, "Got no window to draw"); return; } #ifdef UNIX @@ -1105,7 +1105,7 @@ int clear; if (!winopened) { - error (ERROR, "Got no window to draw"); + error (sERROR, "Got no window to draw"); return; } @@ -1213,7 +1213,7 @@ #endif if (!winopened) { - error (ERROR, "Got no window to draw"); + error (sERROR, "Got no window to draw"); return; } if (cmd->type == cGCOLOUR || cmd->type == cGBACKCOLOUR) { @@ -1224,7 +1224,7 @@ sprintf (string, "arguments to command colour must be between 0 and 255 (not %d,%d,%d)", r, g, b); - error (ERROR, string); + error (sERROR, string); return; } } else { @@ -1235,7 +1235,7 @@ sprintf (string, "string argument to command colour must be three numbers between 0 and 255, separated by commas (not '%s')", h); - error (ERROR, string); + error (sERROR, string); return; } } @@ -1330,7 +1330,7 @@ x = pop (stNUMBER)->value; transform (&x, &y); if (!winopened) { - error (ERROR, "Got no window to draw"); + error (sERROR, "Got no window to draw"); return; } #ifdef UNIX @@ -1432,7 +1432,7 @@ points[3].y = (long) y0; points[3].x = (long) x0; if (!winopened) { - error (ERROR, "Got no window to draw"); + error (sERROR, "Got no window to draw"); return; } #ifdef UNIX @@ -1534,7 +1534,7 @@ sprintf (string, "Found two possible alignments: '%s' and '%s'", arg1, arg2); - error (ERROR, string); + error (sERROR, string); } align = arg2; } else { @@ -1548,9 +1548,9 @@ } } if (arg1 && arg2 && !align) { - error (ERROR, + error (sERROR, "There should be a specification for a text alignment (e.g. 'ct')"); - error (ERROR, "among the last two arguments"); + error (sERROR, "among the last two arguments"); return; } if (!align) { @@ -1565,7 +1565,7 @@ x = pop (stNUMBER)->value; transform (&x, &y); if (!winopened) { - error (ERROR, "Got no window to draw"); + error (sERROR, "Got no window to draw"); return; } @@ -1683,7 +1683,7 @@ int status; #endif if (!winopened) { - error (WARNING, "Got no window to close"); + error (sWARNING, "Got no window to close"); return; } winopened = FALSE; @@ -1714,7 +1714,7 @@ #endif if (!winopened) { - error (WARNING, "Got no window to clear"); + error (sWARNING, "Got no window to clear"); return; } #ifdef UNIX @@ -1749,7 +1749,7 @@ or[0] = tolower ((int) or[0]); or[1] = tolower ((int) or[1]); if (or[2] != '\0' || !strchr ("lcr", or[0]) || !strchr ("tbc", or[1])) { - error (ERROR, "invalid window origin"); + error (sERROR, "invalid window origin"); return; } strcpy (winorigin, or); @@ -1778,7 +1778,7 @@ double xz, yz, xd, yd; double xalt, yalt; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { xalt = *x; yalt = *y; } @@ -1810,10 +1810,10 @@ yd = -1.0; break; } - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf (string, "transforming (%g,%g) into (%g,%g)", xalt, yalt, *x, *y); - error (DEBUG, string); + error (sDEBUG, string); } *x = xz + (*x) * xd; *y = yz + (*y) * yd; @@ -1831,7 +1831,7 @@ double x1, y1, x2, y2, s; if (!winopened) { - error (ERROR, "Got no window to draw"); + error (sERROR, "Got no window to draw"); return; } fill = cmd->tag & dmFILL; @@ -1955,11 +1955,11 @@ #endif /* */ mode = pop (stSTRING)->pointer; if (print_to_file) { - error (ERROR, "Cannot bitblit to printer"); + error (sERROR, "Cannot bitblit to printer"); return; } if (!winopened) { - error (ERROR, "Got no window to draw"); + error (sERROR, "Got no window to draw"); return; } for (pm = mode; *pm; pm++) { @@ -1973,7 +1973,7 @@ sprintf (string, "Invalid mode for bitblit: '%s', only 'solid' and 'transparent' are allowed", mode); - error (ERROR, string); + error (sERROR, string); } ydest = (int) pop (stNUMBER)->value; xdest = (int) pop (stNUMBER)->value; @@ -1991,7 +1991,7 @@ } } if (badimage || w < 0 || h < 0) { - error (ERROR, + error (sERROR, "Invalid bitmap (must start with 'rgb X,Y:', where X and Y are >0)"); return; } @@ -2027,7 +2027,7 @@ XGetImage (display, backbit, xe, ye, we, he, vals.plane_mask, XYPixmap); if (!bits) { - error (ERROR, "Couldn't get bits from window"); + error (sERROR, "Couldn't get bits from window"); return; } } @@ -2037,7 +2037,7 @@ for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { if (!readrgb (NULL, &red, &green, &blue)) { - error (ERROR, "Invalid bitmap"); + error (sERROR, "Invalid bitmap"); return; } should_pixel = rgb_to_pixel (red, green, blue); @@ -2086,7 +2086,7 @@ #endif if (!winopened) { - error (ERROR, "Got no window to draw"); + error (sERROR, "Got no window to draw"); return my_strdup (""); } itransform (&x1, &y1); @@ -2124,7 +2124,7 @@ XGetImage (display, backbit, xe1, ye1, xe2 - xe1 + 1, ye2 - ye1 + 1, vals.plane_mask, XYPixmap); if (!bits) { - error (ERROR, "Couldn't get bits from window"); + error (sERROR, "Couldn't get bits from window"); return my_strdup (""); } } @@ -2278,13 +2278,13 @@ if (stat (printerfilename, &s) && errno != ENOENT) { sprintf (string, "could not check printerfile '%s': %s", printerfilename, my_strerror (errno)); - error (ERROR, string); + error (sERROR, string); return; } if (s.st_mode & S_IFLNK) { sprintf (string, "could not print to file '%s'; it is a symbolic link"); - error (ERROR, string); + error (sERROR, string); return; } printerfile = fopen (printerfilename, "w"); @@ -2297,7 +2297,7 @@ if (!printerfile) { sprintf (string, "could not open file '%s' for printing: %s", printerfilename, my_strerror (errno)); - error (ERROR, string); + error (sERROR, string); } #endif @@ -2321,7 +2321,7 @@ } if (!printer) { - error (ERROR, "Couldn't get handle for printer"); + error (sERROR, "Couldn't get handle for printer"); return; } @@ -2360,11 +2360,11 @@ printerfont = CreateFontIndirect (&logfont); if (printerfont == NULL) { sprintf (string, "Could not create font for printer"); - error (ERROR, string); + error (sERROR, string); return; } if (!SelectObject (printer, printerfont)) { - error (ERROR, "could not select printerfont"); + error (sERROR, "could not select printerfont"); } } di.cbSize = sizeof (DOCINFO); @@ -2374,7 +2374,7 @@ di.fwType = 0; if (StartDoc (printer, &di) == SP_ERROR) { - error (ERROR, "Couldn't start printing"); + error (sERROR, "Couldn't start printing"); return; } StartPage (printer); @@ -2492,7 +2492,7 @@ sprintf (string, "lpr %s", printerfilename); if (system (string)) { sprintf (string, "couldn't print '%s'", printerfilename); - error (ERROR, string); + error (sERROR, string); return; } remove (printerfilename); diff -Nru yabasic-2.82.0/io.c yabasic-2.82.1/io.c --- yabasic-2.82.0/io.c 2019-02-16 21:31:01.000000000 +0000 +++ yabasic-2.82.1/io.c 2019-03-10 17:06:10.000000000 +0000 @@ -188,7 +188,7 @@ if (!myformat(s, q->value, p->pointer, r ? r->pointer : NULL)) { sprintf(string, "'%s' is not a valid format", (char *)p->pointer); - error(ERROR, string); + error (sERROR, string); break; } onestring(string); @@ -225,7 +225,7 @@ x = COLS - 1; } if (!curinized) { - error(ERROR, "need to call 'clear screen' first"); + error (sERROR, "need to call 'clear screen' first"); return; } #ifdef UNIX @@ -277,11 +277,11 @@ if (tcsetpgrp(STDIN_FILENO, getpid())) { sprintf(string,"could not get control of terminal: %s", my_strerror(errno)); - error (ERROR,string); + error (sERROR,string); return; }; if (!initscr()) { - error (ERROR,"could not initialize curses"); + error (sERROR,"could not initialize curses"); return; }; initcol(); @@ -330,7 +330,7 @@ maxtime = 0.01; } if (!curinized) { - error(ERROR, "need to call 'clear screen' first"); + error (sERROR, "need to call 'clear screen' first"); return my_strdup(""); } @@ -421,12 +421,12 @@ /* report result */ #ifdef UNIX if (ret == -1) { - error(ERROR, "waiting for input failed"); + error (sERROR, "waiting for input failed"); break; } #elif WINDOWS if (wait_result == WAIT_FAILED) { - error(ERROR, "waiting for input failed"); + error (sERROR, "waiting for input failed"); break; } @@ -700,7 +700,7 @@ char **pmode; static char *valid_modes[] = { "r", "w", "a", "rb", "wb", "ab", "" }; static int smodes[] = - { stmREAD, stmWRITE, stmWRITE, stmREAD, stmWRITE, stmWRITE }; + { mREAD, mWRITE, mWRITE, mREAD, mWRITE, mWRITE }; int smode; struct stackentry *p; int has_mode, has_stream, printer; @@ -726,7 +726,7 @@ } else { stream = 0; for (i = 1; i < FOPEN_MAX - 4; i++) { - if (stream_modes[i] == stmCLOSED) { + if (stream_modes[i] == mCLOSED) { stream = i; break; } @@ -754,7 +754,7 @@ errorcode = 9; goto open_done; } - if (stream_modes[stream] != stmCLOSED) { + if (stream_modes[stream] != mCLOSED) { sprintf(errorstring, "stream already in use"); errorcode = 2; goto open_done; @@ -834,7 +834,7 @@ result = pop(stNUMBER)->value; if (result <= 0) { - error(ERROR, errorstring); + error (sERROR, errorstring); } } @@ -851,9 +851,9 @@ if (abs(s) == STDIO_STREAM || badstream(s, 0)) { return; } - if (stream_modes[s] == stmCLOSED) { + if (stream_modes[s] == mCLOSED) { sprintf(string, "stream %d already closed", s); - error(WARNING, string); + error (sWARNING, string); return; } if (s == lprstream) { @@ -871,7 +871,7 @@ fclose(streams[s]); } streams[s] = NULL; - stream_modes[s] = stmCLOSED; + stream_modes[s] = mCLOSED; } @@ -912,7 +912,7 @@ if (abs(s) == STDIO_STREAM || badstream(s, 0)) { return; } - if (!(stream_modes[s] & (stmREAD | stmWRITE))) { + if (!(stream_modes[s] & (mREAD | mWRITE))) { sprintf(errorstring, "stream %d not open", s); errorcode = 11; return; @@ -955,10 +955,10 @@ s = push(); s->type = stNUMBER; s->value = oldstream; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf(string, "pushing %d on stack, switching to %d", oldstream, stream); - error(DEBUG, string); + error (sDEBUG, string); } oldstream = stream; mystream(stream); @@ -971,9 +971,9 @@ int stream; stream = (int)pop(stNUMBER)->value; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf(string, "popping %d from stack, switching to it", stream); - error(DEBUG, string); + error (sDEBUG, string); } mystream(stream); } @@ -1017,16 +1017,16 @@ input = (currstr > 0); if (!stdio) { - if (input && !(stream_modes[abs(currstr)] & stmREAD)) { + if (input && !(stream_modes[abs(currstr)] & mREAD)) { sprintf(string, "stream %d not open for reading", abs(currstr)); - error(ERROR, string); + error (sERROR, string); return FALSE; } - if (!input && !(stream_modes[abs(currstr)] & (stmWRITE | stmPRINT))) { + if (!input && !(stream_modes[abs(currstr)] & (mWRITE | mPRINT))) { sprintf(string, "stream %d not open for writing or printing", abs(currstr)); - error(ERROR, string); + error (sERROR, string); return FALSE; } } @@ -1046,7 +1046,7 @@ } result = push(); result->type = stNUMBER; - if (s && !(stream_modes[s] & stmREAD)) { + if (s && !(stream_modes[s] & mREAD)) { result->value = 1.; return; } @@ -1076,7 +1076,7 @@ if (errcode) { errorcode = errcode; } else { - error(ERROR, string); + error (sERROR, string); } return TRUE; } @@ -1345,7 +1345,7 @@ int fc, bc; if (cmd->args && !curinized) { - error(ERROR, "need to call 'clear screen' first"); + error (sERROR, "need to call 'clear screen' first"); return; } if (cmd->args == 0) { @@ -1399,13 +1399,13 @@ fc = name2yc(fore); if (fc < 0) { sprintf(string, "unknown foreground colour: '%s'", fore); - error(ERROR, string); + error (sERROR, string); } if (back) { bc = name2yc(back); if (fc < 0) { sprintf(string, "unknown background colour: '%s'", back); - error(ERROR, string); + error (sERROR, string); } } #ifdef UNIX @@ -1686,7 +1686,7 @@ oldy = csbi.dwCursorPosition.Y; #endif if (sscanf(ch, "%d,%d:%n", &sx, &sy, &n) != 2) { - error(ERROR, "illegal screen string"); + error (sERROR, "illegal screen string"); return; } ch += n; diff -Nru yabasic-2.82.0/main.c yabasic-2.82.1/main.c --- yabasic-2.82.0/main.c 2019-02-16 21:28:16.000000000 +0000 +++ yabasic-2.82.1/main.c 2019-03-10 19:18:59.000000000 +0000 @@ -36,6 +36,7 @@ /* ------------- external references ---------------- */ extern int yylineno; /* line number */ +extern int yycolumn; /* column number */ extern YYLTYPE yylloc; /* line numbers and columns */ extern int yyparse (); /* call bison parser */ extern int yydebug; /* for bison debugging */ @@ -63,8 +64,8 @@ struct command *cmdhead; /* next command */ struct command *lastcmd; /* last command */ struct command *current; /* currently executed command */ -int infolevel; /* controls issuing of error messages */ -int errorlevel; /* highest level of error message seen til now */ +int severity_threshold; /* minimum severity the user wants to see */ +int severity_so_far; /* maximum severity that has been printed until now */ static int debug_count; /* number of debug messages */ static int note_count; /* number of notes */ static int warning_count; /* number of warning messages */ @@ -88,7 +89,7 @@ char *explicit = NULL; /* yabasic commands given on the command line */ char **yabargv; /* arguments for yabasic */ int yabargc; /* number of arguments in yabargv */ -static int endreason = erNONE; /* reason for termination */ +static int endreason = rNONE; /* reason for termination */ static int exitcode = 0; static int signal_arrived = 0; /* timing */ @@ -121,7 +122,7 @@ errorcode = 0; program_state = HATCHED; - infolevel = WARNING; /* set the initial Infolevel */ + severity_threshold = sWARNING; /* set the default severity threshold */ #ifdef WINDOWS @@ -218,11 +219,11 @@ millis_compilation_start = current_millis(); last_inkey=my_malloc(INBUFFLEN); last_inkey[0]='\0'; - error (DEBUG, "This is yabasic " VERSION ", compiled on " ARCHITECTURE ", configured at " BUILD_TIME); + error (sDEBUG, "This is yabasic " VERSION ", compiled on " ARCHITECTURE ", configured at " BUILD_TIME); initialize (); program_state = INITIALIZED; - error (NOTE, "calling parser/compiler"); + error (sNOTE, "calling parser/compiler"); if (interactive) { printf ("%s", BANNER); @@ -241,18 +242,18 @@ printf ("or go to www.yabasic.de for online resources.\n\n"); } program_state = COMPILING; - if (yyparse () && errorlevel > ERROR) { - error (ERROR, "Couldn't parse program"); + if (yyparse () && severity_so_far >= sERROR) { + error (sERROR, "Couldn't parse program"); } - if (errorlevel > ERROR) { + if ( severity_so_far < sERROR) { create_docu_array (); } add_command (cEND, NULL, NULL); sprintf (string, "read %d line(s) and generated %d command(s)", yylineno, commandcount); - error (NOTE, string); + error (sNOTE, string); time (&compilation_end); @@ -260,19 +261,19 @@ if (mybind (to_bind)) { sprintf (string, "Successfully bound '%s' and '%s' into '%s'", inter_path, main_file_name, to_bind); - error (INFO, string); + error (sINFO, string); end_it (); } else { sprintf (string, "Could not bind '%s' and '%s' into '%s'", inter_path, main_file_name, to_bind); - error (ERROR, string); + error (sERROR, string); end_it (); } } - if (errorlevel > ERROR && !check_compat) { + if (severity_so_far < sERROR && !check_compat) { program_state = RUNNING; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { printf ("---Program parsed, press RETURN to continue with its execution: "); fgets (string, INBUFFLEN, stdin); } @@ -284,21 +285,21 @@ ("Check for possible compatibility problems done\nProgram will not be executed, %d possible problem(s) reported\n", warning_count); else { - error (ERROR, "Program not executed"); + error (sERROR, "Program not executed"); } } program_state = FINISHED; sprintf (string, "%d debug(s), %d note(s), %d warning(s), %d error(s)", debug_count, note_count, warning_count, error_count); - error (NOTE, string); + error (sNOTE, string); time (&execution_end); sprintf (string, "compilation time %g second(s), execution %g", (double) (compilation_end - compilation_start), (double) (execution_end - compilation_end)); - error (NOTE, string); + error (sNOTE, string); end_it (); - return !(errorlevel > ERROR); + return !(severity_so_far >= sERROR); } @@ -397,7 +398,7 @@ } else { strcpy (dest, "t[]b"); } - error (DEBUG, string); + error (sDEBUG, string); } struct command * @@ -406,7 +407,7 @@ { struct command *new; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { std_diag ("creating", type, symname, diag); } cmdhead->type = type; /* store command */ @@ -478,7 +479,7 @@ if (dump == NULL) { sprintf(string,"could not open '%s' for writing: %s", dumpfilename,my_strerror(errno)); - error (ERROR,string); + error (sERROR,string); return; } @@ -491,7 +492,7 @@ } if (cmd->type > cLAST_COMMAND || cmd->type < cFIRST_COMMAND) { sprintf (string, "Illegal command type %d", cmd->type); - error(ERROR,string); + error(sERROR,string); return; } if (cmd->type==cEND) { @@ -506,9 +507,9 @@ break; } } - fclose(dump); - sprintf(string,"Dumped to '%s'",dumpfilename); - error(INFO,string); + fclose (dump); + sprintf (string,"Dumped to '%s'",dumpfilename); + error (sINFO,string); } static void @@ -632,34 +633,34 @@ } else if (equal ("-infolevel", option, 2)) { ar++; if (ar >= argc) { - error (ERROR, "no infolevel specified " YABFORHELP); + error (sERROR, "no infolevel specified " YABFORHELP); end_it (); } info = argv[ar]; if (!strncmp (info, "debug", strlen (info))) { - infolevel = DEBUG; + severity_threshold = sDEBUG; } else if (!strncmp (info, "note", strlen (info))) { - infolevel = NOTE; + severity_threshold = sNOTE; } else if (!strncmp (info, "warning", strlen (info))) { - infolevel = WARNING; + severity_threshold = sWARNING; } else if (!strncmp (info, "error", strlen (info))) { - infolevel = ERROR; + severity_threshold = sERROR; } else if (!strncmp (info, "fatal", strlen (info))) { - infolevel = FATAL; + severity_threshold = sFATAL; } else if (!strncmp (info, "bison", strlen (info))) { yydebug = 1; - infolevel = DEBUG; + severity_threshold = sDEBUG; } else { sprintf (string, "there's no infolevel '%s' " YABFORHELP, argv[ar]); - error (ERROR, string); + error (sERROR, string); end_it (); } } else if (equal ("-fg", option, 3) || equal ("-foreground", option, 4)) { ar++; if (ar >= argc) { - error (ERROR, + error (sERROR, "no foreground colour specified " YABFORHELP); end_it (); } @@ -668,7 +669,7 @@ || equal ("-background", option, 2)) { ar++; if (ar >= argc) { - error (ERROR, + error (sERROR, "no background colour specified (-h for help)"); end_it (); } @@ -676,7 +677,7 @@ } else if (equal ("-geometry", option, 2)) { ar++; if (ar >= argc) { - error (ERROR, + error (sERROR, "no geometry string specified (-h for help)"); end_it (); } @@ -684,7 +685,7 @@ } else if (equal ("-bind", option, 3)) { ar++; if (ar >= argc) { - error (ERROR, + error (sERROR, "name of bound program to be written is missing"); end_it (); } @@ -692,28 +693,28 @@ } else if (equal ("-execute", option, 2)) { ar++; if (ar >= argc) { - error (ERROR, "no commands specified (-h for help)"); + error (sERROR, "no commands specified (-h for help)"); end_it (); } explicit = my_strdup (argv[ar]); } else if (equal ("-librarypath", option, 4)) { ar++; if (ar >= argc) { - error (ERROR, "no library path specified (-h for help)"); + error (sERROR, "no library path specified (-h for help)"); end_it (); } strcpy (library_path, argv[ar]); } else if (equal ("-display", option, 3)) { ar++; if (ar >= argc) { - error (ERROR, "no display name specified (-h for help)"); + error (sERROR, "no display name specified (-h for help)"); end_it (); } displayname = my_strdup (argv[ar]); } else if (equal ("-font", option, 4)) { ar++; if (ar >= argc) { - error (ERROR, "no font specified (-h for help)"); + error (sERROR, "no font specified (-h for help)"); end_it (); } fontname = my_strdup (argv[ar]); @@ -733,7 +734,7 @@ main_file_name = my_strdup (option + 6); } else { if (ar >= argc - 1) { - error (ERROR, "no filename specified (-h for help)"); + error (sERROR, "no filename specified (-h for help)"); end_it (); } hold_docu = FALSE; @@ -743,7 +744,7 @@ sprintf (string, "unknown or ambiguous option '%s' " YABFORHELP, option); - error (ERROR, string); + error (sERROR, string); end_it (); } else if (!is_bound && !inputfile && !explicit) { /* not an option */ @@ -754,8 +755,8 @@ if (inputfile == NULL) { sprintf (string, "could not open '%s': %s", main_file_name, my_strerror (errno)); - error (ERROR, string); - endreason = erERROR; + error (sERROR, string); + endreason = rERROR; exitcode = 1; end_it (); } else { @@ -910,9 +911,9 @@ waitpid (backpid, &status, 0); backpid = -1; } - if ((curinized || winopened) && endreason != erREQUEST) { + if ((curinized || winopened) && endreason != rREQUEST) { #else - if (!Commandline && endreason != erREQUEST) { + if (!Commandline && endreason != rREQUEST) { #endif mystream (STDIO_STREAM); onestring ("---Program done, press RETURN---\n"); @@ -981,7 +982,7 @@ #endif /* initialize error handling: no errors seen 'til now */ - errorlevel = DEBUG; + severity_so_far = sDEBUG; debug_count = 0; note_count = 0; warning_count = 0; @@ -1045,10 +1046,10 @@ /* file stuff */ for (i = 1; i <= 9; i++) { streams[i] = NULL; - stream_modes[i] = stmCLOSED; + stream_modes[i] = mCLOSED; } streams[0] = stdin; - stream_modes[0] = stmREAD | stmWRITE; + stream_modes[0] = mREAD | mWRITE; #ifdef UNIX printerfile = NULL; /* no ps-file yet */ #endif @@ -1210,7 +1211,7 @@ for (i = cFIRST_COMMAND; i <= cLAST_COMMAND; i++) { if (!explanation[i]) { sprintf (string, "command %d has no description (command after %s)", i, explanation[i-1]); - error(ERROR,string); + error (sERROR,string); } } @@ -1281,27 +1282,27 @@ switch (sig) { case SIGFPE: - error (FATAL, "floating point exception, cannot proceed."); + error (sFATAL, "floating point exception, cannot proceed."); case SIGSEGV: - error (FATAL, "segmentation fault, cannot proceed."); + error (sFATAL, "segmentation fault, cannot proceed."); case SIGINT: #ifdef UNIX if (backpid == 0) { exit (1); } #endif - error (FATAL, "keyboard interrupt, cannot proceed."); + error (sFATAL, "keyboard interrupt, cannot proceed."); #ifdef SIGHUP case SIGHUP: - error (FATAL, "received signal HANGUP, cannot proceed."); + error (sFATAL, "received signal HANGUP, cannot proceed."); #endif #ifdef SIGQUIT case SIGQUIT: - error (FATAL, "received signal QUIT, cannot proceed."); + error (sFATAL, "received signal QUIT, cannot proceed."); #endif #ifdef SIGABRT case SIGABRT: - error (FATAL, "received signal ABORT, cannot proceed."); + error (sFATAL, "received signal ABORT, cannot proceed."); #endif default: break; @@ -1320,7 +1321,7 @@ /* don't execute program, just print docu */ while (current != cmdhead) { if (current->type == cDOCU) { - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { std_diag ("executing", current->type, current->symname, current->diag); } printf ("%s\n", (char *) current->pointer); @@ -1330,7 +1331,7 @@ fgets (string, INBUFFLEN, stdin); } } else { - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { std_diag ("skipping", current->type, current->symname, current->diag); } } @@ -1344,8 +1345,8 @@ fgets (string, INBUFFLEN, stdin); } } else { - while (current != cmdhead && endreason == erNONE) { - if (infolevel >= DEBUG) { + while (current != cmdhead && endreason == rNONE) { + if (severity_threshold <= sDEBUG) { std_diag ("executing", current->type, current->symname, current->diag); } switch (current->type) { @@ -1681,35 +1682,35 @@ mybind (pop (stSTRING)->pointer); DONE; case cEND: - endreason = erEOF; + endreason = rEOF; break; case cEXIT: exitcode = (int) pop (stNUMBER)->value; - endreason = erREQUEST; + endreason = rREQUEST; break; default: sprintf (string, "Command %s (%d, right before '%s') not implemented", explanation[current->type], current->type, explanation[current->type + 1]); - error (ERROR, string); + error (sERROR, string); } } } program_state = FINISHED; - switch (errorlevel) { - case NOTE: - case DEBUG: - error (NOTE, "Program ended normally."); + switch (severity_so_far) { + case sNOTE: + case sDEBUG: + error (sNOTE, "Program ended normally."); break; - case WARNING: - error (WARNING, "Program ended with a warning"); + case sWARNING: + error (sWARNING, "Program ended with a warning"); break; - case ERROR: - error (ERROR, "Program stopped due to an error"); + case sERROR: + error (sERROR, "Program stopped due to an error"); break; - case FATAL: /* should not come here ... */ - error (FATAL, "Program terminated due to FATAL error"); + case sFATAL: /* should not come here ... */ + error (sFATAL, "Program terminated due to FATAL error"); break; } } @@ -1720,7 +1721,7 @@ /* reports an error to the user and possibly exits */ { if (program_state == COMPILING) { - error_with_position (severity, message, currlib->long_name, yylineno - currlib->yylineno_at_start + 1, yylloc.first_column, yylloc.last_column ); + error_with_position (severity, message, currlib->long_name, yylineno - currlib->yylineno_at_start + 1 - (yycolumn==1 ? 1:0) , yylloc.first_column, yylloc.last_column ); } else if (program_state == RUNNING && current->line > 0) { error_with_position (severity, message, current->lib->long_name, current->line, current->first_column, current->last_column); } else { @@ -1734,10 +1735,10 @@ /* reports an basic error to the user and possibly exits */ { char *severity_text; - static int lastline; - static int first = TRUE; + static int printed_lineno = -1; + static char *printed_filename = NULL; - if (severity <= infolevel) { + if (severity >= severity_threshold) { #ifdef UNIX if (curinized) { reset_shell_mode (); @@ -1745,65 +1746,61 @@ #endif switch (severity) { - case (INFO): + case sINFO: severity_text = "---Info"; break; - case (DUMP): + case sDUMP: severity_text = "---Dump"; break; - case (DEBUG): + case sDEBUG: severity_text = "---Debug"; debug_count++; break; - case (NOTE): + case sNOTE: severity_text = "---Note"; note_count++; break; - case (WARNING): + case sWARNING: severity_text = "---Warning"; warning_count++; break; - case (ERROR): + case sERROR: severity_text = "---Error"; error_count++; break; - case (FATAL): + case sFATAL: severity_text = "---Fatal"; break; } fprintf (stderr, "%s", severity_text); - if (filename) { - if (first || lastline != lineno) { + if (filename && (printed_filename != filename || printed_lineno != lineno)) { fprintf (stderr, " in %s, line %d: %s\n", filename, lineno, message); - if (severity==ERROR) { - show_and_mark_line (filename, lineno, first_column, last_column); - } - } - lastline = lineno; - first = FALSE; + printed_filename = filename; + printed_lineno = lineno; } else { fprintf (stderr, ": %s\n", message); } - if (program_state == RUNNING && severity <= ERROR && severity != DUMP) { + if (filename && severity == sERROR) { + show_and_mark_line (filename, lineno, first_column, last_column); + } + if (program_state == RUNNING && severity <= sERROR && severity != sDUMP) { dump_sub (1); } } - if (severity < errorlevel) { - errorlevel = severity; - } - if (severity <= ERROR) { + if (severity > severity_so_far) severity_so_far = severity; + if (severity >= sERROR) { program_state = FINISHED; - endreason = erERROR; + endreason = rERROR; exitcode = 1; } - if (severity <= FATAL) { + if (severity >= sFATAL) { program_state = FINISHED; fprintf (stderr, "---Immediate exit to system, due to a fatal error.\n"); end_it (); } #ifdef UNIX - if (curinized && severity <= infolevel) { + if (curinized && severity >= severity_threshold) { reset_prog_mode (); } #endif @@ -1888,7 +1885,7 @@ room = malloc (num + sizeof (int)); if (room == NULL) { sprintf (string, "Can't malloc %d bytes of memory", num); - error (FATAL, string); + error (sFATAL, string); } return room; } @@ -1981,7 +1978,7 @@ static char buff[300]; char *at, *dot; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { return name; } dot = strchr (name, '.'); @@ -2015,7 +2012,7 @@ } s = s->prev; } - error (ERROR, pop (stSTRING)->pointer); + error (sERROR, pop (stSTRING)->pointer); } @@ -2051,7 +2048,7 @@ } while (st->type != stFREE); st = st->next; if (st->type != stSTRING) { - error (ERROR, "need a string as a function name"); + error (sERROR, "need a string as a function name"); return; } shortname = st->pointer; @@ -2065,7 +2062,7 @@ sprintf (string, "expecting the name of a numeric function (not '%s')", shortname); - error (ERROR, string); + error (sERROR, string); return; } fullname = my_malloc (strlen (cmd->pointer) + strlen (shortname) + 2); @@ -2076,7 +2073,7 @@ newcurr = search_label (fullname, srmSUBR); if (!newcurr) { sprintf (string, "subroutine '%s' not defined", fullname); - error (ERROR, string); + error (sERROR, string); return; } ret = push (); @@ -2146,13 +2143,13 @@ int offset = 0; if (!inter_path || !inter_path[0]) { - error (FATAL, "inter_path is not set !"); + error (sFATAL, "inter_path is not set !"); return 0; } if (!(inter = fopen (inter_path, "r"))) { sprintf (string, "Couldn't open '%s' to check, if it is bound: %s", inter_path, my_strerror (errno)); - error (WARNING, string); + error (sWARNING, string); return 0; } @@ -2175,61 +2172,61 @@ /* infolevel */ offset -= remlen + 2; if (!seekback (inter, offset, TRUE)) return 0; - if (!fscanf (inter, "%d", &infolevel)) { - error (WARNING, "Could not read infolevel"); + if (!fscanf (inter, "%d", &severity_threshold)) { + error (sWARNING, "Could not read infolevel"); return 0; } /* repeat just for its output side-effect */ if (!seekback (inter, offset, TRUE)) return 0; - switch(infolevel) { - case FATAL: infolevel_text="FATAL";break; - case ERROR: infolevel_text="ERROR";break; - case INFO: infolevel_text="INFO";break; - case DUMP: infolevel_text="DUMP";break; - case WARNING: infolevel_text="WARNING";break; - case NOTE: infolevel_text="NOTE";break; - case DEBUG: infolevel_text="DEBUG";break; - case DEBUG+1: infolevel_text="DEBUG+BISON";yydebug=1;infolevel=DEBUG;break;}; + switch(severity_threshold) { + case sFATAL: infolevel_text="FATAL";break; + case sERROR: infolevel_text="ERROR";break; + case sINFO: infolevel_text="INFO";break; + case sDUMP: infolevel_text="DUMP";break; + case sWARNING: infolevel_text="WARNING";break; + case sNOTE: infolevel_text="NOTE";break; + case sDEBUG: infolevel_text="DEBUG";break; + case sDEBUG-1: infolevel_text="DEBUG+BISON";yydebug=1;severity_threshold=sDEBUG;break;}; sprintf (errorstring, "Set infolevel to %s", infolevel_text); - error (DEBUG, errorstring); + error (sDEBUG, errorstring); /* length of name of embedded program */ offset -= remlen + 8; if (!seekback (inter, offset, TRUE)) return 0; if (!fscanf (inter, "%d", &namelen)) { - error (WARNING, "Could not read length of name of embedded program"); + error (sWARNING, "Could not read length of name of embedded program"); return 0; } sprintf (errorstring, "Length of name of embedded program is %d", namelen); - error (DEBUG, errorstring); + error (sDEBUG, errorstring); /* name of embedded program */ offset -= remlen + namelen; if (!seekback (inter, offset, TRUE)) return 0; progname = (char *) my_malloc (sizeof (char) * (namelen + 1)); if (!fgets (progname, namelen + 1, inter)) { - error (WARNING, "Could not read name of embedded program"); + error (sWARNING, "Could not read name of embedded program"); return 0; } sprintf (errorstring, "Name of embedded program is '%s'", progname); - error (DEBUG, errorstring); + error (sDEBUG, errorstring); /* length of program */ offset -= remlen + 8; if (!seekback (inter, offset, TRUE)) return 0; if (!fscanf (inter, "%d", &proglen)) { - error (WARNING, "Could not read length of embedded program"); + error (sWARNING, "Could not read length of embedded program"); return 0; } sprintf (errorstring, "Length of embedded program is %d", proglen); - error (DEBUG, errorstring); + error (sDEBUG, errorstring); /* seek back to start of embedded program */ offset -= 4 + proglen; /* only the text 'rem ' without preceding linefeed */ if (!seekback (inter, offset, TRUE)) return 0; - if (infolevel >= NOTE) { - error (NOTE, "Dumping the embedded program, that will be executed:"); + if (severity_threshold <= sNOTE) { + error (sNOTE, "Dumping the embedded program, that will be executed:"); fprintf (stderr, " "); for (i = 0; i < proglen; i++) { c = fgetc (inter); @@ -2239,7 +2236,7 @@ } } fprintf (stderr, "\n"); - error (NOTE, "End of program, that will be executed"); + error (sNOTE, "End of program, that will be executed"); printf ("---Press RETURN to continue with its parsing: "); fgets (string, INBUFFLEN, stdin); if (!seekback (inter, offset, TRUE)) return 0; @@ -2255,21 +2252,21 @@ if (fseek (file, offset, SEEK_END)) { sprintf (errorstring, "Couldn't seek within '%s': %s", inter_path, my_strerror (errno)); - error (WARNING, errorstring); + error (sWARNING, errorstring); return FALSE; } if (!fgets (string, INBUFFLEN, file)) { - error (cookie_found ? WARNING:DEBUG, "Could not read from end of embedded program"); + error (cookie_found ? sWARNING:sDEBUG, "Could not read from end of embedded program"); return FALSE; } string[strlen(string) - strlen("\n")] = '\0'; - if (cookie_found && infolevel >= DEBUG) { + if (cookie_found && severity_threshold <= sDEBUG) { sprintf(errorstring, "Next line from end of embbeded program to be processed is: '%s'", string); - error (DEBUG, errorstring); + error (sDEBUG, errorstring); } if (fseek (file, offset, SEEK_END)) { sprintf (errorstring, "Couldn't seek within '%s': %s", inter_path, my_strerror (errno)); - error (WARNING, errorstring); + error (sWARNING, errorstring); return FALSE; } @@ -2289,49 +2286,49 @@ int proglen = 0; if (interactive) { - error (ERROR, "cannot bind a program when called interactively"); + error (sERROR, "cannot bind a program when called interactively"); return 0; } if (!strcmp (inter_path, bound)) { sprintf (string, "will not overwrite '%s' with '%s'", bound, inter_path); - error (ERROR, string); + error (sERROR, string); return 0; } if (!strcmp (main_file_name, bound)) { sprintf (string, "will not overwrite '%s' with '%s'", bound, main_file_name); - error (ERROR, string); + error (sERROR, string); return 0; } if (!(fyab = fopen (inter_path, "rb"))) { sprintf (string, "could not open '%s' for reading: %s", inter_path, my_strerror (errno)); - error (ERROR, string); + error (sERROR, string); return 0; } if (!(fprog = fopen (main_file_name, "rb"))) { sprintf (string, "could not open '%s' for reading: %s", main_file_name, my_strerror (errno)); - error (ERROR, string); + error (sERROR, string); fclose (fyab); return 0; } if (!(fbound = fopen (bound, "wb"))) { sprintf (string, "could not open '%s' for writing: %s", bound, my_strerror (errno)); - error (ERROR, string); + error (sERROR, string); fclose (fyab); fclose (fprog); return 0; } - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf (string, "binding %s and %s into %s", inter_path, main_file_name, bound); - error (NOTE, string); + error (sNOTE, string); } while ((c = fgetc (fyab)) != EOF) { @@ -2341,7 +2338,7 @@ if (!(flib = fopen (library_chain[i]->long_name, "rb"))) { sprintf (string, "could not open '%s' for reading: %s", library_chain[i]->long_name, my_strerror (errno)); - error (ERROR, string); + error (sERROR, string); fclose (flib); return 0; } @@ -2368,7 +2365,7 @@ fprintf (fbound, "rem %08d\n", proglen); fprintf (fbound, "rem %s\n", progname); fprintf (fbound, "rem %08d\n", strlen(progname)); - fprintf (fbound, "rem %02d\n", infolevel + yydebug); + fprintf (fbound, "rem %02d\n", severity_threshold + yydebug); fprintf (fbound, "rem %s\n", YABMAGIC); fclose (fyab); fclose (fprog); diff -Nru yabasic-2.82.0/NEWS yabasic-2.82.1/NEWS --- yabasic-2.82.0/NEWS 2019-02-17 17:16:11.000000000 +0000 +++ yabasic-2.82.1/NEWS 2019-03-11 20:15:20.000000000 +0000 @@ -1,7 +1,3 @@ -Version 2.82.0 (February 17, 2019) - - Advanced version of autoconf and other tools - - Fix in tests - - Fixed nested import of libraries - - Libraries can now be found in the directory of the main file too - - Error messages try to show and mark the offending part of the code - - Hexadecimal numerical literals are supported, e.g. print 0xff +Version 2.82.1 (March 11, 2019) + - Allowing comments after import statement + - Fixes regarding error messages diff -Nru yabasic-2.82.0/symbol.c yabasic-2.82.1/symbol.c --- yabasic-2.82.0/symbol.c 2019-01-01 21:51:44.000000000 +0000 +++ yabasic-2.82.1/symbol.c 2019-03-10 17:06:10.000000000 +0000 @@ -83,9 +83,9 @@ my_free (currsym); currsym = nextsym; } - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf (string, "removed symbol list with %d symbols", count); - error (DEBUG, string); + error (sDEBUG, string); } prevstack = symhead->prev_in_stack; my_free (symhead); @@ -104,20 +104,20 @@ if (s->link) { /* it's a link, don't remove memory */ sprintf (string, "removing linked symbol '%s'", s->name); - error (DEBUG, string); + error (sDEBUG, string); my_free (s->name); return; } if (s->type == sySTRING) { - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf (string, "removing string symbol '%s'", s->name); - error (DEBUG, string); + error (sDEBUG, string); } my_free (s->pointer); } else if (s->type == syARRAY) { - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf (string, "removing array symbol '%s()'", s->name); - error (DEBUG, string); + error (sDEBUG, string); } ar = s->pointer; if (ar->dimension > 0) { @@ -136,9 +136,9 @@ } my_free (ar); } else if (s->type == syNUMBER) { - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf (string, "removing numeric symbol '%s'", s->name); - error (DEBUG, string); + error (sDEBUG, string); } } my_free (s->name); @@ -159,7 +159,7 @@ curr = curr->nextref; } sprintf (string, "removed references from %d symbols", n); - error (DEBUG, string); + error (sDEBUG, string); } @@ -195,7 +195,7 @@ currsym = &((*currsym)->link); linked = TRUE; } - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { if (linked) sprintf (string, "found symbol '%s%s', linked to %s after searching %d symbol(s) in %d stack(s)", @@ -206,7 +206,7 @@ "found symbol '%s%s' after searching %d symbol(s) in %d stack(s)", name, (type == syARRAY) ? "()" : "", symbolcount, stackcount); - error (DEBUG, string); + error (sDEBUG, string); } return *currsym; /* give back address */ } @@ -219,10 +219,10 @@ if (add == amADD_LOCAL) { new = create_symbol (type, name); (*currsym) = new; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf (string, "created local symbol %s%s", name, (type == syARRAY) ? "()" : ""); - error (DEBUG, string); + error (sDEBUG, string); } return new; } @@ -235,10 +235,10 @@ if (add == amADD_GLOBAL) { new = create_symbol (type, name); (*currsym) = new; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf (string, "created global symbol %s%s", name, (type == syARRAY) ? "()" : ""); - error (DEBUG, string); + error (sDEBUG, string); } return new; } @@ -251,10 +251,10 @@ { /* link one symbol to the other */ from->link = to; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf (string, "linking symbol '%s' to '%s'", from->name, to->name); - error (DEBUG, string); + error (sDEBUG, string); } } @@ -266,7 +266,7 @@ struct symbol **currsym; /* go through all lists */ - error (DUMP, "head of symbol stack"); + error (sDUMP, "head of symbol stack"); currstack = symhead; while (currstack) { /* search 'til last element of stack */ @@ -294,10 +294,10 @@ currsym = &((*currsym)->next_in_list); /* try next entry */ } - error (DUMP, string); + error (sDUMP, string); currstack = currstack->prev_in_stack; } - error (DUMP, "root of symbol stack"); + error (sDUMP, "root of symbol stack"); return; } @@ -326,7 +326,7 @@ struct stackentry *a, *b; if ((a = stackhead->prev) == NULL || (b = a->prev) == NULL) { - error (ERROR, "Nothing to swap on stack !"); + error (sERROR, "Nothing to swap on stack !"); return; } a->prev = b->prev; @@ -379,7 +379,7 @@ struct stackentry *s; /* test if there is something on the stack */ - if (stackhead == stackroot) error (FATAL, "Popped too much."); + if (stackhead == stackroot) error (sFATAL, "Popped too much."); stackhead = stackhead->prev; /* move down in stack */ ftype = stackhead->type; if (etype == ftype || etype == stANY || @@ -406,10 +406,10 @@ s->type = stSTRING; s->pointer = my_strdup (""); } - error (ERROR, string); + error (sERROR, string); return s; } else { - error (FATAL, string); + error (sFATAL, string); } return stackhead; } @@ -581,14 +581,14 @@ p = push (); if (!cmd->symname) { - error (WARNING, "invalid pushdblsym"); + error (sWARNING, "invalid pushdblsym"); } if (!cmd->symbol) { cmd->symbol = &(get_sym (cmd->symname, syNUMBER, amADD_GLOBAL)->value); - } else if (infolevel >= DEBUG) { + } else if (severity_threshold <= sDEBUG) { sprintf(string, "reading symbol '%s'", cmd->symname); - error (DEBUG, string); + error (sDEBUG, string); } p->value = *(double *) cmd->symbol; @@ -604,9 +604,9 @@ d = pop (stNUMBER)->value; if (!cmd->symbol) { cmd->symbol = &(get_sym (cmd->symname, syNUMBER, amADD_GLOBAL)->value); - } else if (infolevel >= DEBUG) { + } else if (severity_threshold <= sDEBUG) { sprintf(string, "writing symbol '%s'", cmd->symname); - error (DEBUG, string); + error (sDEBUG, string); } *(double *) (cmd->symbol) = d; @@ -639,7 +639,7 @@ sprintf (string, "static variable '%s' already defined within this subroutine", strip (cmd->symname)); - error (ERROR, string); + error (sERROR, string); return; } @@ -682,7 +682,7 @@ if (get_sym (cmd->symname, cmd->args, amSEARCH_VERY_LOCAL)) { sprintf (string, "'%s()' already defined within this subroutine", strip (cmd->symname)); - error (ERROR, string); + error (sERROR, string); return; } /* get globally defined array */ @@ -694,13 +694,13 @@ } if (!g || !g->pointer) { /* no global array supplied, create one */ - error (DEBUG, "creating dummy array"); + error (sDEBUG, "creating dummy array"); ar = create_array ((cmd->args == stNUMBERARRAYREF) ? 'd' : 's', 0); l->pointer = ar; - if (infolevel >= DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf (string, "creating 0-dimensional dummy array '%s()'", cmd->symname); - error (DEBUG, string); + error (sDEBUG, string); } } else { /* link those two together */ @@ -799,7 +799,7 @@ sprintf (string, "invalid subroutine call: %s expected, %s supplied", expected, supplied); - error (ERROR, string); + error (sERROR, string); } @@ -849,7 +849,7 @@ case (cDBLDIV): if (fabs (b) < DBL_MIN) { sprintf (string, "Division by zero, set to %g", DBL_MAX); - error (NOTE, string); + error (sNOTE, string); c = DBL_MAX; } else { c = a / b; @@ -857,7 +857,7 @@ break; case (cDBLPOW): if ((a == 0 && b <= 0) || (a < 0 && b != (int) b)) { - error (ERROR, "result is not a real number"); + error (sERROR, "result is not a real number"); return; } else { c = pow (a, b); @@ -985,20 +985,20 @@ cmd->args = count_args (FALSE); } if (cmd->args < 0) { - error (ERROR, "only numerical indices allowed for arrays"); + error (sERROR, "only numerical indices allowed for arrays"); return; } s = get_sym (cmd->symname, syARRAY, local ? amADD_LOCAL : amADD_GLOBAL); if (search_label (cmd->symname, srmSUBR | srmLINK)) { sprintf (string, "array '%s()' conflicts with user subroutine", strip (cmd->symname)); - error (ERROR, string); + error (sERROR, string); return; } /* check for dimensions */ if (cmd->args > 10) { - error (ERROR, "more than 10 indices"); + error (sERROR, "more than 10 indices"); return; } oar = s->pointer; @@ -1008,7 +1008,7 @@ sprintf (string, "cannot change dimension of '%s()' from %d to %d", strip (cmd->symname), oar->dimension, cmd->args); - error (ERROR, string); + error (sERROR, string); } } /* check, if redim is actually needed */ @@ -1021,7 +1021,7 @@ if (nbounds[i] <= 1) { sprintf (string, "array index %d is less or equal zero", cmd->args - i); - error (ERROR, string); + error (sERROR, string); return; } if (oar) { @@ -1149,7 +1149,7 @@ if (!sym || !sym->pointer) { sprintf (string, "array '%s()' is not defined", strip (s->pointer)); - error (ERROR, string); + error (sERROR, string); return; } cmd->symbol = sym; @@ -1160,7 +1160,7 @@ if (cmd->type == cARSIZE && (index < 1 || index > ar->dimension)) { sprintf (string, "only indices between 1 and %d allowed", ar->dimension); - error (ERROR, string); + error (sERROR, string); return; } s = push (); @@ -1203,7 +1203,7 @@ if (!sym || !sym->pointer) { sprintf (string, "'%s()' is neither array nor subroutine", strip (cmd->symname)); - error (ERROR, string); + error (sERROR, string); return; } cmd->symbol = sym; @@ -1214,7 +1214,7 @@ cmd->args = count_args (!rval); } if (cmd->args < 0) { - error (ERROR, "only numerical indices allowed for arrays"); + error (sERROR, "only numerical indices allowed for arrays"); return; } cmd->args = abs (cmd->args); @@ -1236,13 +1236,13 @@ if (!ar) { sprintf (string, "array parameter '%s()' has not been supplied", strip (cmd->symname)); - error (ERROR, string); + error (sERROR, string); return; } if (cmd->args != ar->dimension) { sprintf (string, "%d indices supplied, %d expected for '%s()'", cmd->args, ar->dimension, strip (cmd->symname)); - error (ERROR, string); + error (sERROR, string); return; } @@ -1257,7 +1257,7 @@ if (j < 0 || j >= bnd) { sprintf (string, "index %d (=%d) out of range", ar->dimension - i, j); - error (ERROR, string); + error (sERROR, string); return; } index += j * cur; Binary files /tmp/tmpgbysac/LO8iDaRDSd/yabasic-2.82.0/tests/bind_import and /tmp/tmpgbysac/EX69nYVUpl/yabasic-2.82.1/tests/bind_import differ diff -Nru yabasic-2.82.0/tests/bind_import.yab.log yabasic-2.82.1/tests/bind_import.yab.log --- yabasic-2.82.0/tests/bind_import.yab.log 2019-02-19 18:05:46.000000000 +0000 +++ yabasic-2.82.1/tests/bind_import.yab.log 2019-03-11 20:18:04.000000000 +0000 @@ -1 +1 @@ -pid 1692 exit 0 \ No newline at end of file +pid 8816 exit 0 \ No newline at end of file diff -Nru yabasic-2.82.0/tests/common/random.yab.log yabasic-2.82.1/tests/common/random.yab.log --- yabasic-2.82.0/tests/common/random.yab.log 2019-02-19 18:05:55.000000000 +0000 +++ yabasic-2.82.1/tests/common/random.yab.log 2019-03-11 20:18:12.000000000 +0000 @@ -1 +1 @@ -pid 1699 exit 0 \ No newline at end of file +pid 8823 exit 0 \ No newline at end of file diff -Nru yabasic-2.82.0/tests/error/break_error2.yab yabasic-2.82.1/tests/error/break_error2.yab --- yabasic-2.82.0/tests/error/break_error2.yab 2019-02-16 17:59:21.000000000 +0000 +++ yabasic-2.82.1/tests/error/break_error2.yab 2019-03-10 19:50:18.000000000 +0000 @@ -1,6 +1,7 @@ -#expect#---Error in break_error2.yab, line 6: invalid number of levels to break: 4; only 1,2 or 3 are allowed +#expect#---Error in break_error2.yab, line 7: invalid number of levels to break: 4; only 1,2 or 3 are allowed #expect# if (a=2) break 4 #expect# ^ +#expect#---Error: Couldn't parse program #expect#---Error: Program not executed for a=0 to 4 if (a=2) break 4 diff -Nru yabasic-2.82.0/tests/error/break_error2.yab.log yabasic-2.82.1/tests/error/break_error2.yab.log --- yabasic-2.82.0/tests/error/break_error2.yab.log 2019-02-19 18:05:56.000000000 +0000 +++ yabasic-2.82.1/tests/error/break_error2.yab.log 2019-03-11 20:18:12.000000000 +0000 @@ -1,4 +1,5 @@ ----Error in break_error2.yab, line 6: invalid number of levels to break: 4; only 1,2 or 3 are allowed +---Error in break_error2.yab, line 7: invalid number of levels to break: 4; only 1,2 or 3 are allowed if (a=2) break 4 ^ +---Error: Couldn't parse program ---Error: Program not executed diff -Nru yabasic-2.82.0/tests/error/error_line_number2.yab yabasic-2.82.1/tests/error/error_line_number2.yab --- yabasic-2.82.0/tests/error/error_line_number2.yab 1970-01-01 00:00:00.000000000 +0000 +++ yabasic-2.82.1/tests/error/error_line_number2.yab 2019-03-10 19:54:27.000000000 +0000 @@ -0,0 +1,7 @@ +#expect#---Error in error_line_number2.yab, line 7: syntax error +#expect# a = b$ +#expect# ^ +#expect#---Error: Couldn't parse program +#expect#---Error: Program not executed + +a = b$ diff -Nru yabasic-2.82.0/tests/error/error_line_number2.yab.log yabasic-2.82.1/tests/error/error_line_number2.yab.log --- yabasic-2.82.0/tests/error/error_line_number2.yab.log 1970-01-01 00:00:00.000000000 +0000 +++ yabasic-2.82.1/tests/error/error_line_number2.yab.log 2019-03-11 20:18:12.000000000 +0000 @@ -0,0 +1,5 @@ +---Error in error_line_number2.yab, line 7: syntax error + a = b$ + ^ +---Error: Couldn't parse program +---Error: Program not executed diff -Nru yabasic-2.82.0/tests/error/error_line_number_import.yab yabasic-2.82.1/tests/error/error_line_number_import.yab --- yabasic-2.82.0/tests/error/error_line_number_import.yab 1970-01-01 00:00:00.000000000 +0000 +++ yabasic-2.82.1/tests/error/error_line_number_import.yab 2019-03-11 20:08:32.000000000 +0000 @@ -0,0 +1,7 @@ +#expect#---Error in library4e.yab, line 1: syntax error +#expect# a = b$ +#expect# ^ +#expect#---Error: Couldn't parse program +#expect#---Error: Program not executed + +import library4e // contains a simple syntax error diff -Nru yabasic-2.82.0/tests/error/error_line_number_import.yab.log yabasic-2.82.1/tests/error/error_line_number_import.yab.log --- yabasic-2.82.0/tests/error/error_line_number_import.yab.log 1970-01-01 00:00:00.000000000 +0000 +++ yabasic-2.82.1/tests/error/error_line_number_import.yab.log 2019-03-11 20:18:12.000000000 +0000 @@ -0,0 +1,5 @@ +---Error in library4e.yab, line 1: syntax error + a = b$ + ^ +---Error: Couldn't parse program +---Error: Program not executed diff -Nru yabasic-2.82.0/tests/error/error_line_number_with_line_numbers.yab yabasic-2.82.1/tests/error/error_line_number_with_line_numbers.yab --- yabasic-2.82.0/tests/error/error_line_number_with_line_numbers.yab 2019-02-16 17:18:28.000000000 +0000 +++ yabasic-2.82.1/tests/error/error_line_number_with_line_numbers.yab 2019-03-10 19:51:36.000000000 +0000 @@ -1,6 +1,7 @@ -#expect#---Error in error_line_number_with_line_numbers.yab, line 6: syntax error +#expect#---Error in error_line_number_with_line_numbers.yab, line 7: syntax error #expect# 1000 this does not compute :-/ #expect# ^~~~ +#expect#---Error: Couldn't parse program #expect#---Error: Program not executed 1000 this does not compute :-/ diff -Nru yabasic-2.82.0/tests/error/error_line_number_with_line_numbers.yab.log yabasic-2.82.1/tests/error/error_line_number_with_line_numbers.yab.log --- yabasic-2.82.0/tests/error/error_line_number_with_line_numbers.yab.log 2019-02-19 18:05:56.000000000 +0000 +++ yabasic-2.82.1/tests/error/error_line_number_with_line_numbers.yab.log 2019-03-11 20:18:12.000000000 +0000 @@ -1,4 +1,5 @@ ----Error in error_line_number_with_line_numbers.yab, line 6: syntax error +---Error in error_line_number_with_line_numbers.yab, line 7: syntax error 1000 this does not compute :-/ ^~~~ +---Error: Couldn't parse program ---Error: Program not executed diff -Nru yabasic-2.82.0/tests/error/error_line_number.yab yabasic-2.82.1/tests/error/error_line_number.yab --- yabasic-2.82.0/tests/error/error_line_number.yab 2019-02-16 17:03:18.000000000 +0000 +++ yabasic-2.82.1/tests/error/error_line_number.yab 2019-03-10 19:50:19.000000000 +0000 @@ -1,6 +1,7 @@ -#expect#---Error in error_line_number.yab, line 6: syntax error +#expect#---Error in error_line_number.yab, line 7: syntax error #expect# this does not compute :-/ #expect# ^~~~ +#expect#---Error: Couldn't parse program #expect#---Error: Program not executed this does not compute :-/ diff -Nru yabasic-2.82.0/tests/error/error_line_number.yab.log yabasic-2.82.1/tests/error/error_line_number.yab.log --- yabasic-2.82.0/tests/error/error_line_number.yab.log 2019-02-19 18:05:56.000000000 +0000 +++ yabasic-2.82.1/tests/error/error_line_number.yab.log 2019-03-11 20:18:12.000000000 +0000 @@ -1,4 +1,5 @@ ----Error in error_line_number.yab, line 6: syntax error +---Error in error_line_number.yab, line 7: syntax error this does not compute :-/ ^~~~ +---Error: Couldn't parse program ---Error: Program not executed diff -Nru yabasic-2.82.0/tests/error/import_error_line_number_after.yab yabasic-2.82.1/tests/error/import_error_line_number_after.yab --- yabasic-2.82.0/tests/error/import_error_line_number_after.yab 2019-02-16 17:58:16.000000000 +0000 +++ yabasic-2.82.1/tests/error/import_error_line_number_after.yab 2019-03-10 19:55:20.000000000 +0000 @@ -1,6 +1,7 @@ -#expect#---Error in import_error_line_number_after.yab, line 7: syntax error +#expect#---Error in import_error_line_number_after.yab, line 8: syntax error #expect# this does not compute :-/ #expect# ^~~~ +#expect#---Error: Couldn't parse program #expect#---Error: Program not executed import library2e diff -Nru yabasic-2.82.0/tests/error/import_error_line_number_after.yab.log yabasic-2.82.1/tests/error/import_error_line_number_after.yab.log --- yabasic-2.82.0/tests/error/import_error_line_number_after.yab.log 2019-02-19 18:05:56.000000000 +0000 +++ yabasic-2.82.1/tests/error/import_error_line_number_after.yab.log 2019-03-11 20:18:12.000000000 +0000 @@ -1,4 +1,5 @@ ----Error in import_error_line_number_after.yab, line 7: syntax error +---Error in import_error_line_number_after.yab, line 8: syntax error this does not compute :-/ ^~~~ +---Error: Couldn't parse program ---Error: Program not executed diff -Nru yabasic-2.82.0/tests/error/import_error_line_number.yab yabasic-2.82.1/tests/error/import_error_line_number.yab --- yabasic-2.82.0/tests/error/import_error_line_number.yab 2019-02-16 22:38:50.000000000 +0000 +++ yabasic-2.82.1/tests/error/import_error_line_number.yab 2019-03-10 19:56:07.000000000 +0000 @@ -1,6 +1,7 @@ #expect#---Error in library1e.yab, line 4: syntax error #expect# This cannot be parsed :-/ #expect# ^~~~~~ +#expect#---Error: Couldn't parse program #expect#---Error: Program not executed # Error in library with correct line number diff -Nru yabasic-2.82.0/tests/error/import_error_line_number.yab.log yabasic-2.82.1/tests/error/import_error_line_number.yab.log --- yabasic-2.82.0/tests/error/import_error_line_number.yab.log 2019-02-19 18:05:55.000000000 +0000 +++ yabasic-2.82.1/tests/error/import_error_line_number.yab.log 2019-03-11 20:18:12.000000000 +0000 @@ -1,4 +1,5 @@ ---Error in library1e.yab, line 4: syntax error This cannot be parsed :-/ ^~~~~~ +---Error: Couldn't parse program ---Error: Program not executed diff -Nru yabasic-2.82.0/tests/error/library2e.yab yabasic-2.82.1/tests/error/library2e.yab --- yabasic-2.82.0/tests/error/library2e.yab 2019-02-16 22:30:18.000000000 +0000 +++ yabasic-2.82.1/tests/error/library2e.yab 2019-03-11 19:39:25.000000000 +0000 @@ -1,4 +1,4 @@ # Simple library that can be imported without problems -# on additional line +# one additional line # another one diff -Nru yabasic-2.82.0/tests/error/library3e.yab yabasic-2.82.1/tests/error/library3e.yab --- yabasic-2.82.0/tests/error/library3e.yab 1970-01-01 00:00:00.000000000 +0000 +++ yabasic-2.82.1/tests/error/library3e.yab 2019-03-10 17:06:10.000000000 +0000 @@ -0,0 +1,4 @@ +x=0 +repeat + x=x+1 + diff -Nru yabasic-2.82.0/tests/error/library4e.yab yabasic-2.82.1/tests/error/library4e.yab --- yabasic-2.82.0/tests/error/library4e.yab 1970-01-01 00:00:00.000000000 +0000 +++ yabasic-2.82.1/tests/error/library4e.yab 2019-03-11 05:19:40.000000000 +0000 @@ -0,0 +1 @@ +a = b$ diff -Nru yabasic-2.82.0/tests/error/missing_until_in_library.yab yabasic-2.82.1/tests/error/missing_until_in_library.yab --- yabasic-2.82.0/tests/error/missing_until_in_library.yab 1970-01-01 00:00:00.000000000 +0000 +++ yabasic-2.82.1/tests/error/missing_until_in_library.yab 2019-03-10 20:00:10.000000000 +0000 @@ -0,0 +1,4 @@ +#expect#---Error in missing_until.yab, line 7: repeat-loop +import library3e + +until (x>10) diff -Nru yabasic-2.82.0/tests/error/missing_until.yab yabasic-2.82.1/tests/error/missing_until.yab --- yabasic-2.82.0/tests/error/missing_until.yab 2019-02-16 23:05:20.000000000 +0000 +++ yabasic-2.82.1/tests/error/missing_until.yab 2019-03-11 20:06:55.000000000 +0000 @@ -1,4 +1,5 @@ -#expect#---Error in missing_until.yab, line 8: repeat-loop starting at line 6 has seen no 'until' at end of file +#expect#---Error: repeat-loop starting at line 7 has seen no 'until' at end of program +#expect#---Error: Couldn't parse program #expect#---Error: Program not executed import library2e diff -Nru yabasic-2.82.0/tests/error/missing_until.yab.log yabasic-2.82.1/tests/error/missing_until.yab.log --- yabasic-2.82.0/tests/error/missing_until.yab.log 2019-02-19 18:05:56.000000000 +0000 +++ yabasic-2.82.1/tests/error/missing_until.yab.log 2019-03-11 20:18:12.000000000 +0000 @@ -1,2 +1,3 @@ ----Error in missing_until.yab, line 8: repeat-loop starting at line 6 has seen no 'until' at end of file +---Error: repeat-loop starting at line 7 has seen no 'until' at end of program +---Error: Couldn't parse program ---Error: Program not executed diff -Nru yabasic-2.82.0/tests/hex.yab.log yabasic-2.82.1/tests/hex.yab.log --- yabasic-2.82.0/tests/hex.yab.log 2019-02-19 18:05:46.000000000 +0000 +++ yabasic-2.82.1/tests/hex.yab.log 2019-03-11 20:18:04.000000000 +0000 @@ -1 +1 @@ -pid 1695 exit 0 \ No newline at end of file +pid 8819 exit 0 \ No newline at end of file diff -Nru yabasic-2.82.0/tests/import.yab yabasic-2.82.1/tests/import.yab --- yabasic-2.82.0/tests/import.yab 2019-02-16 23:25:45.000000000 +0000 +++ yabasic-2.82.1/tests/import.yab 2019-03-10 17:06:10.000000000 +0000 @@ -1,5 +1,5 @@ #!./yabasic -import library8 +import library8 // comments allowed on same line print foo$() diff -Nru yabasic-2.82.0/tests/import.yab.log yabasic-2.82.1/tests/import.yab.log --- yabasic-2.82.0/tests/import.yab.log 2019-02-19 18:05:46.000000000 +0000 +++ yabasic-2.82.1/tests/import.yab.log 2019-03-11 20:18:04.000000000 +0000 @@ -1 +1 @@ -pid 1698 exit 0 \ No newline at end of file +pid 8822 exit 0 \ No newline at end of file diff -Nru yabasic-2.82.0/tests/interpreter_and_program.yab.log yabasic-2.82.1/tests/interpreter_and_program.yab.log --- yabasic-2.82.0/tests/interpreter_and_program.yab.log 2019-02-19 18:05:45.000000000 +0000 +++ yabasic-2.82.1/tests/interpreter_and_program.yab.log 2019-03-11 20:18:04.000000000 +0000 @@ -1 +1 @@ -pid 1671 exit 0 \ No newline at end of file +pid 8795 exit 0 \ No newline at end of file diff -Nru yabasic-2.82.0/tests/#library9.yab# yabasic-2.82.1/tests/#library9.yab# --- yabasic-2.82.0/tests/#library9.yab# 2019-02-17 20:43:41.000000000 +0000 +++ yabasic-2.82.1/tests/#library9.yab# 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -import library10 - -export sub first_level_import_func() - return second_level_import_func() -end sub Binary files /tmp/tmpgbysac/LO8iDaRDSd/yabasic-2.82.0/tests/nested_bind_import and /tmp/tmpgbysac/EX69nYVUpl/yabasic-2.82.1/tests/nested_bind_import differ diff -Nru yabasic-2.82.0/tests/nested_bind_import.yab.log yabasic-2.82.1/tests/nested_bind_import.yab.log --- yabasic-2.82.0/tests/nested_bind_import.yab.log 2019-02-19 18:05:46.000000000 +0000 +++ yabasic-2.82.1/tests/nested_bind_import.yab.log 2019-03-11 20:18:04.000000000 +0000 @@ -1 +1 @@ -pid 1676 exit 0 \ No newline at end of file +pid 8800 exit 0 \ No newline at end of file diff -Nru yabasic-2.82.0/tests/run_in_script.sh.log yabasic-2.82.1/tests/run_in_script.sh.log --- yabasic-2.82.0/tests/run_in_script.sh.log 2019-02-19 18:05:59.000000000 +0000 +++ yabasic-2.82.1/tests/run_in_script.sh.log 2019-03-11 20:18:15.000000000 +0000 @@ -1,2 +1,2 @@ -Found expected string >>Echo of 17632<< +Found expected string >>Echo of 14214<< PASS tests/run_in_script.sh (exit status: 0) diff -Nru yabasic-2.82.0/tests/speed.yab.log yabasic-2.82.1/tests/speed.yab.log --- yabasic-2.82.0/tests/speed.yab.log 2019-02-19 18:05:45.000000000 +0000 +++ yabasic-2.82.1/tests/speed.yab.log 2019-03-11 20:18:04.000000000 +0000 @@ -1 +1 @@ -pid 1666 exit 0 \ No newline at end of file +pid 8790 exit 0 \ No newline at end of file diff -Nru yabasic-2.82.0/tests/system.yab.log yabasic-2.82.1/tests/system.yab.log --- yabasic-2.82.0/tests/system.yab.log 2019-02-19 18:05:56.000000000 +0000 +++ yabasic-2.82.1/tests/system.yab.log 2019-03-11 20:18:13.000000000 +0000 @@ -29,7 +29,6 @@ flow.gcda flow.gcno flow.o -foo format_sources.sh function.c function.gcda @@ -58,7 +57,6 @@ Makefile.in missing mkinstalldirs -nested_bind_import NEWS out.dat pkg @@ -116,7 +114,6 @@ flow.gcda flow.gcno flow.o -foo format_sources.sh function.c function.gcda @@ -145,7 +142,6 @@ Makefile.in missing mkinstalldirs -nested_bind_import NEWS out.dat pkg diff -Nru yabasic-2.82.0/yabasic.bison yabasic-2.82.1/yabasic.bison --- yabasic-2.82.0/yabasic.bison 2019-02-17 16:59:55.000000000 +0000 +++ yabasic-2.82.1/yabasic.bison 2019-03-11 20:05:25.000000000 +0000 @@ -57,9 +57,13 @@ int loop_nesting=0; int switch_nesting=0; -void report_if_missing(int severity,char *text) { +void report_if_missing(int severity,char *text,int eof) { if (missing_loop || missing_endif || missing_next || missing_until || missing_wend) { - error(severity,text); + if (eof) { + error_without_position(severity,text); + } else { + error(severity,text); + } string[0]='\0'; if (missing_endif) sprintf(string,"if-statement starting at line %d has seen no 'endif' yet",missing_endif_line); @@ -71,7 +75,9 @@ sprintf(string,"repeat-loop starting at line %d has seen no 'until' yet",missing_until_line); else if (missing_loop) sprintf(string,"do-loop starting at line %d has seen no 'loop' yet",missing_loop_line); - if (string[0]) error(severity,string); + if (string[0]) { + error_without_position(severity,string); + } } } @@ -148,7 +154,7 @@ ; statement_list: statement - | statement_list {if (errorlevel<=ERROR) {YYABORT;}} + | statement_list {if (severity_so_far >= sERROR) {YYABORT;}} tSEP statement ; @@ -157,21 +163,21 @@ | tLET string_assignment | assignment | tLET assignment - | tIMPORT {report_if_missing(ERROR,"can not import a library in a loop or an if-statement");} + | tIMPORT {report_if_missing(sERROR,"can not import a library in a loop or an if-statement",FALSE);} | tERROR string_expression {add_command(cERROR,NULL,NULL);} | for_loop | switch_number_or_string | repeat_loop | while_loop | do_loop - | tBREAK {add_command(cPOP_MULTI,NULL,NULL);create_mybreak(1);if (!loop_nesting && !switch_nesting) lyyerror(@1,ERROR,"break outside loop or switch");} - | tBREAK tDIGITS {add_command(cPOP_MULTI,NULL,NULL);create_mybreak(atoi($2));if (!loop_nesting && !switch_nesting) lyyerror(@1,ERROR,"break outside loop or switch");} - | tCONTINUE {add_command(cPOP_MULTI,NULL,NULL);add_command_with_switch_state(cCONTINUE);if (!loop_nesting) lyyerror(@1,ERROR,"continue outside loop");} + | tBREAK {add_command(cPOP_MULTI,NULL,NULL);create_mybreak(1);if (!loop_nesting && !switch_nesting) lyyerror(@1,sERROR,"break outside loop or switch");} + | tBREAK tDIGITS {add_command(cPOP_MULTI,NULL,NULL);create_mybreak(atoi($2));if (!loop_nesting && !switch_nesting) lyyerror(@1,sERROR,"break outside loop or switch");} + | tCONTINUE {add_command(cPOP_MULTI,NULL,NULL);add_command_with_switch_state(cCONTINUE);if (!loop_nesting) lyyerror(@1,sERROR,"continue outside loop");} | function_definition | function_or_array {create_call($1);add_command(cPOP,NULL,NULL);} | stringfunction_or_array {create_call($1);add_command(cPOP,NULL,NULL);} - | tLOCAL {if (function_type==ftNONE) lyyerror(@1,ERROR,"no use for 'local' outside functions");} local_list - | tSTATIC {if (function_type==ftNONE) lyyerror(@1,ERROR,"no use for 'static' outside functions");} static_list + | tLOCAL {if (function_type==ftNONE) lyyerror(@1,sERROR,"no use for 'local' outside functions");} local_list + | tSTATIC {if (function_type==ftNONE) lyyerror(@1,sERROR,"no use for 'static' outside functions");} static_list | if_clause | short_if | tGOTO symbol_or_lineno {create_goto((function_type!=ftNONE)?dotify($2,TRUE):$2);} @@ -210,8 +216,8 @@ } else { add_command(cRETURN_FROM_GOSUB,NULL,NULL); }} - | tRETURN expression {if (function_type==ftNONE) {lyyerror(@1,ERROR,"a value can only be returned from a subroutine"); YYABORT;} add_command(cCLEARREFS,NULL,NULL);lastcmd->nextref=firstref;add_command(cPOPSYMLIST,NULL,NULL);create_check_return_value(ftNUMBER,function_type);add_command(cRETURN_FROM_CALL,NULL,NULL);} - | tRETURN string_expression {if (function_type==ftNONE) {lyyerror(@1,ERROR,"can not return value"); YYABORT;} add_command(cCLEARREFS,NULL,NULL);lastcmd->nextref=firstref;add_command(cPOPSYMLIST,NULL,NULL);create_check_return_value(ftSTRING,function_type);add_command(cRETURN_FROM_CALL,NULL,NULL);} + | tRETURN expression {if (function_type==ftNONE) {lyyerror(@1,sERROR,"a value can only be returned from a subroutine"); YYABORT;} add_command(cCLEARREFS,NULL,NULL);lastcmd->nextref=firstref;add_command(cPOPSYMLIST,NULL,NULL);create_check_return_value(ftNUMBER,function_type);add_command(cRETURN_FROM_CALL,NULL,NULL);} + | tRETURN string_expression {if (function_type==ftNONE) {lyyerror(@1,sERROR,"can not return value"); YYABORT;} add_command(cCLEARREFS,NULL,NULL);lastcmd->nextref=firstref;add_command(cPOPSYMLIST,NULL,NULL);create_check_return_value(ftSTRING,function_type);add_command(cRETURN_FROM_CALL,NULL,NULL);} | tDIM dimlist | tOPEN tWINDOW expression ',' expression {create_openwin(FALSE);} | tOPEN tWINDOW expression ',' expression ',' string_expression @@ -299,7 +305,7 @@ string_expression: tSTRSYM {add_command(cPUSHSTRSYM,dotify($1,FALSE),NULL);} | string_function | stringfunction_or_array {add_command(cSTRINGFUNCTION_OR_ARRAY,$1,NULL);} - | tSTRING {if ($1==NULL) {lyyerror(@1,ERROR,"String not terminated");create_pushstr("");} else {create_pushstr($1);}} + | tSTRING {if ($1==NULL) {lyyerror(@1,sERROR,"String not terminated");create_pushstr("");} else {create_pushstr($1);}} | string_expression '+' string_expression {add_command(cCONCAT,NULL,NULL);} | '(' string_expression ')' ; @@ -414,7 +420,7 @@ | tASC '(' string_expression ')' {create_function(fASC);} | tDEC '(' string_expression ')' {create_function(fDEC);} | tDEC '(' string_expression ',' expression ')' {create_function(fDEC2);} - | tINSTR '(' string_expression ',' string_expression ')' {if (check_compat) lyyerror(@1,WARNING,"instr() has changed in version 2.712"); create_function(fINSTR);} + | tINSTR '(' string_expression ',' string_expression ')' {if (check_compat) lyyerror(@1,sWARNING,"instr() has changed in version 2.712"); create_function(fINSTR);} | tINSTR '(' string_expression ',' string_expression ',' expression ')' {create_function(fINSTR2);} | tRINSTR '(' string_expression ',' string_expression ')' {create_function(fRINSTR);} | tRINSTR '(' string_expression ',' string_expression ',' expression ')' {create_function(fRINSTR2);} @@ -488,7 +494,7 @@ | expression ; -function_definition: export tSUB {missing_endsub++;missing_endsub_line=yylineno;pushlabel();report_if_missing(WARNING,"do not define a function in a loop or an if-statement");if (function_type!=ftNONE) {lyyerror(@1,ERROR,"nested functions not allowed");YYABORT;}} +function_definition: export tSUB {missing_endsub++;missing_endsub_line=yylineno;pushlabel();report_if_missing(sWARNING,"do not define a function in a loop or an if-statement",FALSE);if (function_type!=ftNONE) {lyyerror(@1,sERROR,"nested functions not allowed");YYABORT;}} function_name {if (exported) create_subr_link($4); create_label($4,cUSER_FUNCTION); add_command(cPUSHSYMLIST,NULL,NULL);add_command(cCLEARREFS,NULL,NULL);firstref=lastref=lastcmd; create_count_params();} @@ -497,7 +503,7 @@ endsub {add_command(cCLEARREFS,NULL,NULL);lastcmd->nextref=firstref;add_command(cPOPSYMLIST,NULL,NULL);create_check_return_value(ftNONE,function_type);function_type=ftNONE;add_command(cRETURN_FROM_CALL,NULL,NULL);lastref=NULL;create_endfunction();poplabel();} ; -endsub: tEOPROG {if (missing_endsub) {sprintf(string,"subroutine starting at line %d has seen no 'end sub' at end of file",missing_endsub_line);lyyerror(@1,ERROR,string);} YYABORT;} +endsub: tEOPROG {if (missing_endsub) {sprintf(string,"subroutine starting at line %d has seen no 'end sub' at end of program",missing_endsub_line);error_without_position(sERROR,string);} YYABORT;} | tENDSUB {missing_endsub--;} ; @@ -566,7 +572,7 @@ next next_symbol {add_command(cBREAK_HERE,NULL,NULL);add_command(cEND_LOOP_MARK,NULL,NULL);loop_nesting--;} ; -next: tEOPROG {if (missing_next) {sprintf(string,"for-loop starting at line %d has seen not 'next' at end of file",missing_next_line);lyyerror(@1,ERROR,string);} YYABORT;} +next: tEOPROG {if (missing_next) {sprintf(string,"for-loop starting at line %d has seen no 'next' at end of program",missing_next_line);error_without_position(sERROR,string);} YYABORT;} | tNEXT {missing_next--;} ; @@ -576,7 +582,7 @@ next_symbol: {pop(stSTRING);}/* can be omitted */ | tSYMBOL {if (strcmp(pop(stSTRING)->pointer,dotify($1,FALSE))) - {lyyerror(@1,ERROR,"'for' and 'next' do not match"); YYABORT;} + {lyyerror(@1,sERROR,"'for' and 'next' do not match"); YYABORT;} } ; @@ -610,7 +616,7 @@ ; -loop: tEOPROG {if (missing_loop) {sprintf(string,"do-loop starting at at line %d has seen no 'loop' at end of file",missing_loop_line);lyyerror(@1,ERROR,string);} YYABORT;} +loop: tEOPROG {if (missing_loop) {sprintf(string,"do-loop starting at at line %d has seen no 'loop' at end of program",missing_loop_line);error_without_position(sERROR,string);} YYABORT;} | tLOOP {missing_loop--;popgoto();add_command(cBREAK_HERE,NULL,NULL);add_command(cEND_LOOP_MARK,NULL,NULL);loop_nesting--;} ; @@ -622,7 +628,7 @@ wend ; -wend: tEOPROG {if (missing_wend) {sprintf(string,"while-loop starting at line %d has seen no 'wend' at end of file",missing_wend_line);lyyerror(@1,ERROR,string);} YYABORT;} +wend: tEOPROG {if (missing_wend) {sprintf(string,"while-loop starting at line %d has seen no 'wend' at end of program",missing_wend_line);error_without_position(sERROR,string);} YYABORT;} | tWEND {missing_wend--;swap();popgoto();poplabel();add_command(cBREAK_HERE,NULL,NULL);add_command(cEND_LOOP_MARK,NULL,NULL);loop_nesting--;} ; @@ -632,7 +638,7 @@ until ; -until: tEOPROG {if (missing_until) {sprintf(string,"repeat-loop starting at line %d has seen no 'until' at end of file",missing_until_line);lyyerror(@1,ERROR,string);} YYABORT;} +until: tEOPROG {if (missing_until) {sprintf(string,"repeat-loop starting at line %d has seen no 'until' at end of program",missing_until_line);error_without_position(sERROR,string);} YYABORT;} | tUNTIL '(' expression ')' {missing_until--;add_command(cDECIDE,NULL,NULL);popgoto();add_command(cBREAK_HERE,NULL,NULL);add_command(cEND_LOOP_MARK,NULL,NULL);loop_nesting--;} ; @@ -644,7 +650,7 @@ endif ; -endif: tEOPROG {if (missing_endif) {sprintf(string,"if-clause starting at line %d has seen no 'fi' at end of file",missing_endif_line);lyyerror(@1,ERROR,string);} YYABORT;} +endif: tEOPROG {if (missing_endif) {sprintf(string,"if-clause starting at line %d has seen no 'fi' at end of program",missing_endif_line);error_without_position(sERROR,string);} YYABORT;} | tENDIF {missing_endif--;} ; @@ -751,7 +757,7 @@ %code { void yyerror(char *message) { - error(ERROR,message); + error(sERROR,message); } void diff -Nru yabasic-2.82.0/yabasic.flex yabasic-2.82.1/yabasic.flex --- yabasic-2.82.0/yabasic.flex 2019-02-17 21:09:02.000000000 +0000 +++ yabasic-2.82.1/yabasic.flex 2019-03-11 19:59:38.000000000 +0000 @@ -49,9 +49,9 @@ %% <> { - if (infolevel>=DEBUG) { - sprintf(string,"closing file '%s'",currlib->short_name); - error(DEBUG,string); + if (severity_threshold <= sDEBUG) { + sprintf(string,"Closing file '%s'",currlib->short_name); + error(sDEBUG,string); } if (--include_depth<0) { return tEOPROG; @@ -60,6 +60,7 @@ yy_delete_buffer(YY_CURRENT_BUFFER); yy_switch_to_buffer(include_stack[include_depth]); } + report_if_missing(sERROR,"Premature end of file",TRUE); leave_lib(); return tSEP; } @@ -79,14 +80,14 @@ \n\n {yycolumn=1; if (fi_pending) {fi_pending--;yyless(0);return tENDIF;}if (interactive && !inlib) {return tEOPROG;} else {return tSEP;}} \n {yycolumn=1; if (fi_pending) {fi_pending--;yyless(0);return tENDIF;};return tSEP;} -: {if (fi_pending && check_compat) error(WARNING,"short-if has changed in version 2.71");return tSEP;} +: {if (fi_pending && check_compat) error(sWARNING,"Short if has changed in version 2.71");return tSEP;} REM{WS}+.* {return tSEP;} /* comments span 'til end of line */ \/\/.* {return tSEP;} /* comments span 'til end of line */ REM\n {yycolumn=1; if (fi_pending) {fi_pending--;yyless(0);return tENDIF;};return tSEP;} REM {yymore();} -IMPORT{WS}+{NAME}\n {BEGIN(PASTIMPORT);import_lib(my_strdup(yytext+7));return tIMPORT;} +IMPORT{WS}+{NAME} {BEGIN(PASTIMPORT);import_lib(my_strdup(yytext+7));return tIMPORT;} .* {yycolumn=1;BEGIN(INITIAL);yyless(0);unput('\n');return tSEP;} \n {yycolumn=1;BEGIN(INITIAL);return tSEP;} @@ -379,7 +380,7 @@ /* This can only occur in bound programs; void all further import-statements */ if (!strcmp(name,"__END_OF_ALL_IMPORTS")) { - error(DEBUG,"Encountered special import __END_OF_ALL_IMPORTS"); + error(sDEBUG,"Encountered special import __END_OF_ALL_IMPORTS"); end_of_all_imports=TRUE; } @@ -387,7 +388,7 @@ /* This can only occur in bound programs, close currently imported library */ if (!strcmp(name,"__END_OF_CURRENT_IMPORT")) { - error(DEBUG,"Encountered special import __END_OF_CURRENT_IMPORT"); + error(sDEBUG,"Encountered special import __END_OF_CURRENT_IMPORT"); include_depth--; leave_lib(); ignore_nested_imports=FALSE; @@ -396,7 +397,7 @@ /* This can only occur in bound programs, ignore nested import-statement */ if (!strcmp(name,"__IGNORE_NESTED_IMPORTS")) { - error(DEBUG,"Encountered special import __IGNORE_NESTED_IMPORTS"); + error(sDEBUG,"Encountered special import __IGNORE_NESTED_IMPORTS"); ignore_nested_imports=TRUE; } @@ -406,7 +407,7 @@ inlib=TRUE; if (include_depth>=MAX_INCLUDE_DEPTH) { sprintf(string,"Could not import '%s': nested too deep (%d)",name,include_depth); - error(ERROR,string); + error(sERROR,string); return FALSE; } @@ -422,22 +423,22 @@ library_chain[library_chain_length++]=library_stack[include_depth]; if (library_chain_length>=MAX_INCLUDE_NUMBER) { sprintf(string,"Cannot import more than %d libraries",MAX_INCLUDE_NUMBER); - error(ERROR,string); + error(sERROR,string); return FALSE; } if (!library_stack[include_depth]) { sprintf(string,"library '%s' has already been imported",full); - error(ERROR,string); + error(sERROR,string); return FALSE; } - if (infolevel>=NOTE) { + if (severity_threshold <= sNOTE) { if (isbound) { sprintf(string,"importing library '%s'",name); } else { sprintf(string,"importing from file '%s'",full); } - error(NOTE,string); + error(sNOTE,string); } currlib=library_stack[include_depth]; /* switch late because error() uses currlib */ return TRUE; @@ -461,12 +462,12 @@ name=unquoted; if (strchr(name,'.')) { sprintf(string,"library name '%s' contains '.'",name); - error(ERROR,string); + error(sERROR,string); return NULL; } if (!strcmp(name,"main")) { if (is_bound) return NULL; - error(ERROR,"invalid library name 'main'"); + error(sERROR,"invalid library name 'main'"); return NULL; } @@ -516,7 +517,7 @@ if (lib) return lib; sprintf(string,"could not open library '%s': not in current workingdir as '%s', not in directory of main file as '%s', not in library path as '%s'",name,full_wdir,full_main,full_global); - error(ERROR,string); + error(sERROR,string); return NULL; } @@ -524,9 +525,9 @@ void leave_lib(void) /* processing, when end of library is found */ { if (include_depth<0) return; - if (infolevel>=DEBUG) { + if (severity_threshold <= sDEBUG) { sprintf(string,"End of library '%s', continue with '%s', include depth is now %d",currlib->short_name,library_stack[include_depth]->short_name,include_depth); - error(DEBUG,string); + error(sDEBUG,string); } yylineno=currlib->yylineno_at_start; currlib=library_stack[include_depth]; diff -Nru yabasic-2.82.0/yabasic.h yabasic-2.82.1/yabasic.h --- yabasic-2.82.0/yabasic.h 2019-02-16 18:27:47.000000000 +0000 +++ yabasic-2.82.1/yabasic.h 2019-03-11 19:57:55.000000000 +0000 @@ -95,8 +95,8 @@ extern struct command *cmdroot; /* first command */ extern struct command *cmdhead; /* next command */ extern struct command *lastcmd; /* last command */ -extern int infolevel; /* controls issuing of error messages */ -extern int errorlevel; /* highest level of error message seen til now */ +extern int severity_threshold; /* minimum severity the user wants to see */ +extern int severity_so_far; /* maximum severity that has been printed until now */ extern int interactive; /* true, if commands come from stdin */ extern char *progname; /* name of yabasic-program */ extern char *explanation[]; /* explanations of commands */ @@ -216,7 +216,8 @@ extern int yydebug; extern int missing_endif; extern int missing_endif_line; - +void report_if_missing(int,char *,int); + /*-------------------------- defs and undefs ------------------------*/ /* undef symbols */ @@ -247,19 +248,19 @@ /* ---------------------- enum types ------------------------------- */ -enum error { +enum severity { /* error levels */ - FATAL, ERROR, INFO, DUMP, WARNING, NOTE, DEBUG + sBISON, sDEBUG, sNOTE, sWARNING, sDUMP, sINFO, sERROR, sFATAL }; enum end_reasons { /* ways to end the program */ - erNONE, erERROR, erREQUEST, erEOF + rNONE, rERROR, rREQUEST, rEOF }; enum stream_modes { /* ways to access a stream */ - stmCLOSED = 0, stmREAD = 1, stmWRITE = 2, stmPRINT = 4 + mCLOSED = 0, mREAD = 1, mWRITE = 2, mPRINT = 4 }; enum functions {