Imported from ../bash-2.05b.tar.gz.

This commit is contained in:
Jari Aalto 2002-07-17 14:10:11 +00:00
commit 7117c2d221
362 changed files with 34387 additions and 15063 deletions

View file

@ -1,7 +1,7 @@
This file is let.def, from which is created let.c.
It implements the builtin "let" in Bash.
Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -24,13 +24,16 @@ $FUNCTION let_builtin
$PRODUCES let.c
$SHORT_DOC let arg [arg ...]
Each ARG is an arithmetic expression to be evaluated. Evaluation
is done in long integers with no check for overflow, though division
by 0 is trapped and flagged as an error. The following list of
operators is grouped into levels of equal-precedence operators.
is done in fixed-width integers with no check for overflow, though
division by 0 is trapped and flagged as an error. The following
list of operators is grouped into levels of equal-precedence operators.
The levels are listed in order of decreasing precedence.
id++, id-- variable post-increment, post-decrement
++id, --id variable pre-increment, pre-decrement
-, + unary minus, plus
!, ~ logical and bitwise negation
** exponentiation
*, /, % multiplication, division, remainder
+, - addition, subtraction
<<, >> left and right bitwise shifts
@ -48,7 +51,7 @@ The levels are listed in order of decreasing precedence.
&=, ^=, |= assignment
Shell variables are allowed as operands. The name of the variable
is replaced by its value (coerced to a long integer) within
is replaced by its value (coerced to a fixed-width integer) within
an expression. The variable need not have its integer attribute
turned on to be used in an expression.
@ -77,9 +80,13 @@ int
let_builtin (list)
WORD_LIST *list;
{
long ret;
intmax_t ret;
int expok;
/* Skip over leading `--' argument. */
if (list && list->word && ISOPTION (list->word->word, '-'))
list = list->next;
if (list == 0)
{
builtin_error ("expression expected");
@ -102,7 +109,8 @@ exp_builtin (list)
WORD_LIST *list;
{
char *exp;
int ret, expok;
intmax_t ret;
int expok;
if (list == 0)
{