Commit Graph

4 Commits

Author SHA1 Message Date
ridiculousfish
c7f16439bf Add support for ! as an analog to 'not'
! and not are effectively interchangeable now.
Mark them both as operators for syntax highlighting.
2018-03-05 14:04:49 -08:00
ridiculousfish
357d3b8c6d Rework 'and' and 'or' to be "job decorators"
This promotes "and" and "or" from a type of statement to "job
decorators," as a possible prefix on a job. The point is to rationalize
how they interact with && and ||.

In the new world 'and' and 'or' apply to a entire job conjunction, i.e.
they have "lower precedence." Example:

if [ $age -ge 0 ] && [ $age -le 18 ]
   or [ $age -ge 75 ] && [ $age -le 100 ]
   echo "Child or senior"
end
2018-03-05 13:41:36 -08:00
ridiculousfish
e1dafeab01 Add && and || support to the conditions of if and while
This updates the "boolean tail" feature of the if and while conditions
to know about job_conjunction, thereby respecting && and ||
2018-03-05 13:39:36 -08:00
ridiculousfish
8e9670ccd5 Implement execution of && and ||
This adds support for basic constructs. if and while is not yet
supported.
2018-03-05 12:20:56 -08:00