Mercurial > octave
changeset 33262:c338b0cb940e bytecode-interpreter
maint: merge default to bytecode-interpreter
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 28 Mar 2024 00:33:50 -0400 |
parents | 8609599b7019 (current diff) ab68bff7b8b8 (diff) |
children | 1a8c76030b24 |
files | |
diffstat | 5 files changed, 31 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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;
--- 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 <tok> SPMD %token <tok> IF ELSEIF ELSE %token <tok> SWITCH CASE OTHERWISE -%token <tok> BREAK CONTINUE FUNC_RET +%token <tok> BREAK CONTINUE RETURN %token <tok> UNWIND CLEANUP %token <tok> TRY CATCH %token <tok> GLOBAL PERSISTENT @@ -232,7 +232,7 @@ %token <tok> SUPERCLASSREF %token <tok> FQ_IDENT %token <tok> GET SET -%token <tok> FCN +%token <tok> FUNCTION %token <tok> ARGUMENTS %token <tok> LEXICAL_ERROR %token <tok> 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
--- 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
--- 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)