# HG changeset patch # User John W. Eaton # Date 1593623899 14400 # Node ID a5541f5a78ddefc74b68f952db703a70db52ccef # Parent 23a33db2bdb3f4ec68c7927ad6882deac4c9251a make parsing of spmd and endspmd keywords work properly (bug #58676) * lex.ll (base_lexer::make_keyword_token): Enable lines left commented out in changeset 6e8a9845d118. Now the spmd and endspmd keywords will be recognized properly and return the correct tokens. * oct-parse.yy (base_parser::make_spmd_command): Fix copy/paste error from changeset b8ab8b58547d so that END token checking will work properly. diff -r 23a33db2bdb3 -r a5541f5a78dd libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll Wed Jul 01 16:04:22 2020 +0900 +++ b/libinterp/parse-tree/lex.ll Wed Jul 01 13:18:19 2020 -0400 @@ -2843,18 +2843,13 @@ } break; - /* Unimplementd 'spmd' keyword for Matlab compatibility only. - FIXME: Allow spmd statement, but treat as no-op, bug #58676. */ case spmd_kw: - /* m_at_beginning_of_statement = true; */ + m_at_beginning_of_statement = true; break; case endspmd_kw: - /* - tok_val = new token (endspmd_kw, token::spmd_end, m_tok_beg, - m_tok_end); + tok_val = new token (endspmd_kw, token::spmd_end, m_tok_beg, m_tok_end); m_at_beginning_of_statement = true; - */ break; case magic_file_kw: diff -r 23a33db2bdb3 -r a5541f5a78dd libinterp/parse-tree/oct-parse.yy --- a/libinterp/parse-tree/oct-parse.yy Wed Jul 01 16:04:22 2020 +0900 +++ b/libinterp/parse-tree/oct-parse.yy Wed Jul 01 13:18:19 2020 -0400 @@ -3253,7 +3253,7 @@ { tree_spmd_command *retval = nullptr; - if (end_token_ok (end_tok, token::if_end)) + if (end_token_ok (end_tok, token::spmd_end)) { int l = spmd_tok->line (); int c = spmd_tok->column ();