Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: not an error?



On Oct 8, 10:44am, Ray Andrews wrote:
}
} print -rl "${(@k)aliases}}"
} 
} Shouldn't the parser complain about the extra '}'?

Why would it?  You've put it in double quotes, so this is the same
situation as

print -rl "}"

} certainly complains about too many opening '{', tho.

Consider

print -rl "{${(@k)aliases}}"
print -rl "${(@k)aliases}{}"
print -rl "${(@k)aliases}}{"

Given the quotes, the only reason too many open braces is a problem is
when you are inside the syntax of ${...} where braces are significant.
As soon as a matching close-brace is found, double-quote context is
active again and braces cease to have meaning.



Messages sorted by: Reverse Date, Date, Thread, Author