X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Flanguage%2Fstats%2Fmatrix.c;h=37b565e05eba85cce43d341ff2b315a9212ac319;hb=50d37e46e023dd5cda55eac32c5e37554489db3b;hp=c1e4adff8e793a05664add867495b80574ec9184;hpb=15d30a4c251fe810f3697bd287afdc8b1699487d;p=pspp diff --git a/src/language/stats/matrix.c b/src/language/stats/matrix.c index c1e4adff8e..37b565e05e 100644 --- a/src/language/stats/matrix.c +++ b/src/language/stats/matrix.c @@ -3383,7 +3383,7 @@ matrix_expr_evaluate_exp_mat (const struct matrix_expr *e, if (bf != floor (bf) || bf <= LONG_MIN || bf > LONG_MAX) { msg_at (SE, matrix_expr_location (e->subs[1]), - _("Exponent %.1f in matrix multiplication is non-integer " + _("Exponent %.1f in matrix exponentiation is non-integer " "or outside the valid range."), bf); return NULL; } @@ -5367,25 +5367,12 @@ matrix_print_parse (struct matrix_state *s) if (lex_token (s->lexer) != T_SLASH && lex_token (s->lexer) != T_ENDCMD) { - size_t depth = 0; - for (size_t i = 0; ; i++) - { - enum token_type t = lex_next_token (s->lexer, i); - if (t == T_LPAREN || t == T_LBRACK || t == T_LCURLY) - depth++; - else if ((t == T_RPAREN || t == T_RBRACK || t == T_RCURLY) && depth) - depth--; - else if ((t == T_SLASH && !depth) || t == T_ENDCMD || t == T_STOP) - { - if (i > 0) - cmd->print.title = lex_next_representation (s->lexer, 0, i - 1); - break; - } - } - + int start_ofs = lex_ofs (s->lexer); cmd->print.expression = matrix_parse_exp (s); if (!cmd->print.expression) goto error; + cmd->print.title = lex_ofs_representation (s->lexer, start_ofs, + lex_ofs (s->lexer) - 1); } while (lex_match (s->lexer, T_SLASH))