Change the command-line option for disabling line length checking

Signed-off-by: Gavin Howard <gavin@yzena.com>
line_libs
Gavin Howard 1 year ago
parent 601179321d
commit be81c86e31
Signed by: gavin
GPG Key ID: C08038BDF280D33E
  1. 2
      src/args.c
  2. 4
      src/data.c
  3. 2
      src/dc_lex.c
  4. 6
      tests/other.sh

@ -177,7 +177,7 @@ void bc_args(int argc, char *argv[], bool exit_exprs) {
break;
}
case 'C':
case 'L':
{
vm.line_len = 0;
break;

@ -141,8 +141,8 @@ const BcOptLong bc_args_lopt[] = {
{ "file", BC_OPT_REQUIRED, 'f' },
{ "help", BC_OPT_NONE, 'h' },
{ "interactive", BC_OPT_NONE, 'i' },
{ "leading-zero", BC_OPT_NONE, 'z' },
{ "no-char-limit", BC_OPT_NONE, 'C' },
{ "leading-zeroes", BC_OPT_NONE, 'z' },
{ "no-line-length", BC_OPT_NONE, 'L' },
{ "no-prompt", BC_OPT_NONE, 'P' },
{ "no-read-prompt", BC_OPT_NONE, 'R' },
#if BC_ENABLED

@ -252,7 +252,7 @@ void dc_lex_token(BcLex *l) {
{
c2 = l->buf[l->i];
if (c2 == 'c') l->t = BC_LEX_KW_LINE_LENGTH;
if (c2 == 'l') l->t = BC_LEX_KW_LINE_LENGTH;
else if (c2 == 'z') l->t = BC_LEX_KW_LEADING_ZERO;
else bc_lex_invalidChar(l, c);

@ -82,7 +82,7 @@ else
lopt="mathlib"
line_var="DC_LINE_LENGTH"
num="$num pR"
lltest="gcpR"
lltest="glpR"
fi
# I use these, so unset them to make the tests work.
@ -249,12 +249,12 @@ checktest "$d" "$?" "line length 2" "$out1" "$out2"
printf '%s\n' "$num2" > "$out1"
export "$line_var"=62
printf '%s\n' "$num" | "$exe" "$@" -C > "$out2"
printf '%s\n' "$num" | "$exe" "$@" -L > "$out2"
checktest "$d" "$?" "line length 3" "$out1" "$out2"
printf '0\n' > "$out1"
printf '%s\n' "$lltest" | "$exe" "$@" -C > "$out2"
printf '%s\n' "$lltest" | "$exe" "$@" -L > "$out2"
checktest "$d" "$?" "line length 3" "$out1" "$out2"

Loading…
Cancel
Save