summaryrefslogtreecommitdiff
path: root/bin/expr/expr.y
AgeCommit message (Collapse)Author
2001-09-16Use {g,s}etprogname, and some other KNF stuff. Patch by Petri Koistinen.wiz
2001-05-06Various cleanups/fixes.jmc
Change the add/subtract overflow checks to use an unsigned to do the op and then cast back into the signed var to check the signs. Make multiply shortcut on either right or left being 0. Make multiply's overflow test not fail on simple cases like 1 * -1 Make the multiple overflow test pass all the regress tests.
2001-05-05Various changes to fix bugs in PR bin/12838.jmc
Make sure all precendence is spelled out correctly (comparison does not have the same level as the arithmetic operators..) Break the arithemtic operators into 2 classes (+- are lower than */%) Restructure the arithmetic code into a function either class above can call. Finally, add a whole suite of regression tests (checked in separately) which the previous code failed on 3 of them.
2001-04-25Spell occurred correctly.simonb
2001-02-04remove redundant declaration of yyparsechristos
2000-10-30add a hack to properly handle '--' as first argument -jdolecek
it's ignored if it would cause syntax error, otherwise treated as common string; this is so that both 'expr -- : .' and 'expr -- foo : .' works This addresses standards/11230 by Ben Harris. while here, make all global variables but main() static, use const more
2000-10-29The "&" operator has a higer precedence than "|".thorpej
2000-10-27also credit J.T. Conklin in copyright messagejdolecek
2000-10-26fix operator precedence - | or & have lower priority thanjdolecek
arithmetic operations, compare, or : This should fix bin/11318 by Love <lha@stacken.kth.se>
2000-09-29in regexp handling code, fix the format passed to asprintf() to bejdolecek
actually in intended form - use "%.*s" and not incorrect "%*s" Bug found by Launey Thomas <ljt@alum.mit.edu> and reported in private e-mail.
2000-09-21Fix bug in regexp handling, caused not quite complete conversionjdolecek
from old expr.c. This fixes PR # 11060. While here, convert the code to use asprintf() instead of strdup() followed by truncating of new string and move definition of errstr to block where it's used.
2000-09-19reimplement expr using lexical parser generated by yaccjdolecek
highlights: * / is treated correctly depending upon context (addresses PR # 10995) * use 64 bit arithmetic, so expr is able to process integer values from -(2**63) to (2**63 - 1) * checks for integer over- & underflows added * error messages improved, more error checking added add AUTHOR section to manpage add BUGS section, and mention possible drawbacks with other expr implementations XXX the old expr treated empty string in arithmetic expressions as if it was 0 XXX this behaviour has been retained
1994-07-16Clean up deleted files.mycroft
1994-07-10don't forget a cast, and thereby fix the regexp problems on big-endian machinescgd
1993-11-16Fix insignificant memory leak.jtc
1993-10-04Allow expressions like "expr 'ABC' : '^.*$' to work as is done in otherjtc
expr implementations.
1993-09-14Fix grammar to eliminate support for unary minus expressions -- theyjtc
weren't supported, they aren't standard, and they caused expr to dump core.
1993-08-17Use err() routine for error messages.jtc
If string does not match \( \) subexpression, return a null string.
1993-08-16expr is supposed to do string comparisons using the locale specificjtc
collation sequence, so use strcoll instead of strcmp.
1993-07-20Now truely POSIX 1003.2 (D11.2) compliant.jtc
1993-07-20Don't coerce strings to int in comparisons.jtc
1993-07-20integer arguments were not coerced to strings for the `:' operator.jtc
bad things: core dumps, etc. will happen if integer values make it up the parse tree.
1993-06-14Updated to POSIX regular expression routines.jtc
(Previous checkin was aborted by stray ^C)
1993-06-05update for latest version of patches from jtconklin@kaleida.comcgd
1993-03-23added J.T. Conklin's changes to get parens working fine, etc.cgd
1993-03-23changed "Id" to "Header" for rcsidscgd
1993-03-22added rcs ids to all filescgd
1993-03-21initial import of 386bsd-0.1 sourcescgd