Browse Source

.control and `B' parser, fix precedence of '-' versus '^'

-2^2 shall be -(2^2) instead of (-2)^2
pre-master-46
rlar 13 years ago
parent
commit
b32ae9f79b
  1. 2
      src/frontend/parse-bison.y
  2. 2
      src/spicelib/parser/inpptree-parser.y

2
src/frontend/parse-bison.y

@ -96,8 +96,8 @@
%right ','
%left '-' '+'
%left '*' '/' '%'
%right '^' /* exponentiation */
%left NEG /* negation--unary minus */
%right '^' /* exponentiation */
%left '[' ']'
%left TOK_LRANGE TOK_RRANGE

2
src/spicelib/parser/inpptree-parser.y

@ -73,8 +73,8 @@
%left TOK_LE TOK_LT TOK_GE TOK_GT
%left '-' '+'
%left '*' '/'
%left '^' /* exponentiation */
%left NEG '!' /* negation--unary minus, and boolean not */
%left '^' /* exponentiation */
%initial-action /* initialize yylval */
{

Loading…
Cancel
Save