9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: 9front@9front.org
Subject: Re: [9front] Patch to fix test(1) expression parsing
Date: Sat, 01 Aug 2020 21:35:11 -0700	[thread overview]
Message-ID: <E9E8D68749ED2FE3B24FE5F4ED9D9A5F@eigenstate.org> (raw)
In-Reply-To: <C78A9F156D6F66601DB36AA5AA854C7E@musolino.id.au>

> Hi all,
> 
> The following patch fixes test(1) to correctly parse its own
> expression syntax whilst avoiding executing of filesystem operations
> when these tests ought not to be performed due to short-circuiting.
> 
> Previously, short-circuiting of -a and -o logical operators would
> result in an incorrect parse.  For example, the following invocations

Generally looks good, will test tomorrow -- just a minor comment:

> fail:
> 
> term% test '(' 1 -gt 2 -a 1 -gt 1 ')'
> test: ) expected
> term% test '(' 2 -gt 1 -o 1 -gt 1 ')'
> test: ) expected
> 

> -	r = e();
> +	r = e(1);
>  	/*
>  	 * nice idea but short-circuit -o and -a operators may have
>  	 * not consumed their right-hand sides.

This comment seems outdated -- we can use the nice idea and
error out appropriately now.



  parent reply	other threads:[~2020-08-02  4:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-01 16:14 Alex Musolino
2020-08-01 16:38 ` [9front] " Alex Musolino
2020-08-02  4:35 ` ori [this message]
2020-08-02  4:39   ` Alex Musolino
2020-08-02  4:51     ` ori
2020-08-03 13:45     ` Alex Musolino
2020-10-31 14:10       ` cinap_lenrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E9E8D68749ED2FE3B24FE5F4ED9D9A5F@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).