Skip to content

Commit

Permalink
APREPRO: EQ and NE comparisons exp and string are valid
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed May 20, 2024
1 parent b9d2436 commit 75040b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
4 changes: 2 additions & 2 deletions packages/seacas/libraries/aprepro_lib/apr_aprepro.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#endif

namespace {
const std::string version_short{"6.31"};
const std::string version_date{"(2024/05/13)"};
const std::string version_short{"6.32"};
const std::string version_date{"(2024/05/20)"};
const std::string version_string = version_short + " " + version_date;

void output_copyright();
Expand Down
10 changes: 1 addition & 9 deletions packages/seacas/libraries/aprepro_lib/apr_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Skeleton implementation for Bison LALR(1) parsers in C++

// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
// Copyright (C) 2002-2015, 2018-2021, 2024 Free Software Foundation, Inc.

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -749,15 +749,11 @@ namespace SEAMS {
case 44: // bool: exp EQ sexp
{
(yylhs.value.val) = false;
yyerror(aprepro, "Comparison of arithmetic with string not defined");
yyerrok;
} break;

case 45: // bool: exp NE sexp
{
(yylhs.value.val) = true;
yyerror(aprepro, "Comparison of arithmetic with string not defined");
yyerrok;
} break;

case 46: // bool: sexp LT exp
Expand Down Expand Up @@ -791,15 +787,11 @@ namespace SEAMS {
case 50: // bool: sexp EQ exp
{
(yylhs.value.val) = false;
yyerror(aprepro, "Comparison of string with arithmetic not defined");
yyerrok;
} break;

case 51: // bool: sexp NE exp
{
(yylhs.value.val) = true;
yyerror(aprepro, "Comparison of string with arithmetic not defined");
yyerrok;
} break;

case 52: // bool: UNDVAR LT sexp
Expand Down
8 changes: 4 additions & 4 deletions packages/seacas/libraries/aprepro_lib/aprepro.yy
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@ bool: sexp LT sexp { $$ = (strcmp($1,$3) < 0 ? 1 : 0); }
| exp GT sexp { $$ = false; yyerror(aprepro, "Comparison of arithmetic with string not defined"); yyerrok;}
| exp LE sexp { $$ = false; yyerror(aprepro, "Comparison of arithmetic with string not defined"); yyerrok;}
| exp GE sexp { $$ = false; yyerror(aprepro, "Comparison of arithmetic with string not defined"); yyerrok;}
| exp EQ sexp { $$ = false; yyerror(aprepro, "Comparison of arithmetic with string not defined"); yyerrok;}
| exp NE sexp { $$ = true; yyerror(aprepro, "Comparison of arithmetic with string not defined"); yyerrok;}
| exp EQ sexp { $$ = false; }
| exp NE sexp { $$ = true; }

| sexp LT exp { $$ = false; yyerror(aprepro, "Comparison of string with arithmetic not defined"); yyerrok;}
| sexp GT exp { $$ = false; yyerror(aprepro, "Comparison of string with arithmetic not defined"); yyerrok;}
| sexp LE exp { $$ = false; yyerror(aprepro, "Comparison of string with arithmetic not defined"); yyerrok;}
| sexp GE exp { $$ = false; yyerror(aprepro, "Comparison of string with arithmetic not defined"); yyerrok;}
| sexp EQ exp { $$ = false; yyerror(aprepro, "Comparison of string with arithmetic not defined"); yyerrok;}
| sexp NE exp { $$ = true; yyerror(aprepro, "Comparison of string with arithmetic not defined"); yyerrok;}
| sexp EQ exp { $$ = false; }
| sexp NE exp { $$ = true; }

| UNDVAR LT sexp { $$ = (strcmp("",$3) < 0 ? 1 : 0); undefined_error(aprepro, $1->name); }
| UNDVAR GT sexp { $$ = (strcmp("",$3) > 0 ? 1 : 0); undefined_error(aprepro, $1->name); }
Expand Down

0 comments on commit 75040b4

Please sign in to comment.