# HG changeset patch # User John W. Eaton # Date 1711600430 14400 # Node ID c338b0cb940ea2179cff8df39586d9e7edc8a59f # Parent 8609599b7019ef3661735ed9acdcbc92caf949c4# Parent ab68bff7b8b8819eef68de1379f96fadcb581f71 maint: merge default to bytecode-interpreter diff -r 8609599b7019 -r c338b0cb940e libinterp/corefcn/panic.h --- a/libinterp/corefcn/panic.h Tue Mar 26 18:27:16 2024 -0400 +++ b/libinterp/corefcn/panic.h Thu Mar 28 00:33:50 2024 -0400 @@ -41,19 +41,23 @@ // panic_impossible, panic_if, and panic_unless symbols must be defined // as macros. -#define panic_impossible() \ +#if defined (NDEBUG) + +# define panic_impossible() do { } while (0) + +# define panic_if(cond) do { } while (0) + +# define panic_unless(cond) do { } while (0) + +#else + +# define panic_impossible() \ ::panic ("impossible state reached in file '%s' at line %d", __FILE__, __LINE__) -#if defined (NDEBUG) -# define panic_if(cond) -#else # define panic_if(cond) do { if (cond) panic_impossible (); } while (0) -#endif -#if defined (NDEBUG) -# define panic_unless(cond) -#else # define panic_unless(cond) panic_if (! (cond)) + #endif #endif diff -r 8609599b7019 -r c338b0cb940e libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll Tue Mar 26 18:27:16 2024 -0400 +++ b/libinterp/parse-tree/lex.ll Thu Mar 28 00:33:50 2024 -0400 @@ -3695,7 +3695,7 @@ case OTHERWISE: std::cerr << "OTHERWISE\n"; break; case BREAK: std::cerr << "BREAK\n"; break; case CONTINUE: std::cerr << "CONTINUE\n"; break; - case FUNC_RET: std::cerr << "FUNC_RET\n"; break; + case RETURN: std::cerr << "RETURN\n"; break; case UNWIND: std::cerr << "UNWIND\n"; break; case CLEANUP: std::cerr << "CLEANUP\n"; break; case TRY: std::cerr << "TRY\n"; break; @@ -3705,7 +3705,7 @@ case FCN_HANDLE: std::cerr << "FCN_HANDLE\n"; break; case END_OF_INPUT: std::cerr << "END_OF_INPUT\n\n"; break; case LEXICAL_ERROR: std::cerr << "LEXICAL_ERROR\n\n"; break; - case FCN: std::cerr << "FCN\n"; break; + case FUNCTION: std::cerr << "FUNCTION\n"; break; case INPUT_FILE: std::cerr << "INPUT_FILE\n"; break; case SUPERCLASSREF: std::cerr << "SUPERCLASSREF\n"; break; case METAQUERY: std::cerr << "METAQUERY\n"; break; diff -r 8609599b7019 -r c338b0cb940e libinterp/parse-tree/oct-parse.yy --- a/libinterp/parse-tree/oct-parse.yy Tue Mar 26 18:27:16 2024 -0400 +++ b/libinterp/parse-tree/oct-parse.yy Thu Mar 28 00:33:50 2024 -0400 @@ -221,7 +221,7 @@ %token SPMD %token IF ELSEIF ELSE %token SWITCH CASE OTHERWISE -%token BREAK CONTINUE FUNC_RET +%token BREAK CONTINUE RETURN %token UNWIND CLEANUP %token TRY CATCH %token GLOBAL PERSISTENT @@ -232,7 +232,7 @@ %token SUPERCLASSREF %token FQ_IDENT %token GET SET -%token FCN +%token FUNCTION %token ARGUMENTS %token LEXICAL_ERROR %token END_OF_INPUT @@ -1264,7 +1264,7 @@ if (! ($$ = parser.make_continue_command ($1))) YYABORT; } - | FUNC_RET + | RETURN { $$ = parser.make_return_command ($1); } ; @@ -1562,7 +1562,7 @@ // Function definition // =================== -function_beg : push_fcn_symtab FCN +function_beg : push_fcn_symtab FUNCTION { $$ = $2; if (lexer.m_reading_classdef_file diff -r 8609599b7019 -r c338b0cb940e libinterp/parse-tree/octave.gperf --- a/libinterp/parse-tree/octave.gperf Tue Mar 26 18:27:16 2024 -0400 +++ b/libinterp/parse-tree/octave.gperf Thu Mar 28 00:33:50 2024 -0400 @@ -114,7 +114,7 @@ enumeration, ENUMERATION, enumeration_kw events, EVENTS, events_kw for, FOR, for_kw -function, FCN, function_kw +function, FUNCTION, function_kw get, GET, get_kw global, GLOBAL, global_kw if, IF, if_kw @@ -123,7 +123,7 @@ parfor, PARFOR, parfor_kw persistent, PERSISTENT, persistent_kw properties, PROPERTIES, properties_kw -return, FUNC_RET, return_kw +return, RETURN, return_kw set, SET, set_kw spmd, SPMD, spmd_kw switch, SWITCH, switch_kw diff -r 8609599b7019 -r c338b0cb940e liboctave/util/lo-error.h --- a/liboctave/util/lo-error.h Tue Mar 26 18:27:16 2024 -0400 +++ b/liboctave/util/lo-error.h Thu Mar 28 00:33:50 2024 -0400 @@ -85,18 +85,22 @@ // liboctave_panic_impossible, liboctave_panic_if, and // liboctave_panic_unless symbols must be defined as macros. -#define liboctave_panic_impossible() (*current_liboctave_error_handler) ("impossible state reached in file '%s' at line %d", __FILE__, __LINE__) +#if defined (NDEBUG) + +# define liboctave_panic_impossible() do { } while (0) + +# define liboctave_panic_if(cond) do { } while (0) -#if defined (NDEBUG) -# define liboctave_panic_if(cond) +# define liboctave_panic_unless(cond) do { } while (0) + #else + +# define liboctave_panic_impossible() (*current_liboctave_error_handler) ("impossible state reached in file '%s' at line %d", __FILE__, __LINE__) + # define liboctave_panic_if(cond) do { if (cond) liboctave_panic_impossible (); } while (0) -#endif -#if defined (NDEBUG) -# define liboctave_panic_unless(cond) -#else # define liboctave_panic_unless(cond) liboctave_panic_if (! (cond)) + #endif #if defined (__cplusplus)