Parsing/Shunting-yard algorithm: Difference between revisions

→‎{{header|UNIX Shell}}: Refactor. Fake news is still there, bitches!! <3 💯👌
(→‎{{header|UNIX Shell}}: Refactor. Fake news is still there, bitches!! <3 💯👌)
Line 4,229:
grep -q '^[-+*/^%]$' <<< "$1"
if [ "$?" -eq 0 ]; then
topop="`sedif [ -n '$p' <<< "$ops"`" ]; then
if [ -n "$topop" ] || [ \! "$topop" = '(' ]; then
thispred=`getopprec "$1"`
thisassoc=`getopassoc "$1"`
if [ -n "$ topop="`sed ]-n ||'$p' [ \!<<< "$topopops"`" = '(' ]; then
thatpred=`getopprec "$topop"`
thatassoc=`getopassoc "$topop"`
Line 4,256:
fi
 
grepif -q[ "$1" = '^($' <<<]; "$1"then
if [ "$?" -eq 0 ]; then
ops="`sed -e '$a'"$1" -e '/^$/d' <<< "$ops"`"
 
Line 4,264 ⟶ 4,263:
fi
 
grepif -q[ "$1" = '^)$' <<<]; "$1"then
if [ "$?" -eq 0 ]; then
grep -q '^($' <<< "`sed -n '$p' <<< "$ops"`"
while [ "$?" -ne 0 ]; do
Anonymous user