9fans / plan9port

Plan 9 from User Space
https://9fans.github.io/plan9port/
Other
1.61k stars 319 forks source link

plumber: runaway quoted string literals are silently accepted in plumbing rules #568

Closed igorburago closed 1 year ago

igorburago commented 2 years ago

Whenever a nontrivial string is constructed as a concatenation of variable substitutions and quoted string literals within a variable or rule definition, it is not hard to leave out a quote or add an extra one by mistake.

Since the constructed string is always bounded by the next upcoming newline, when this happens within an argument of a verb in a single rule, it is not as big of a problem, as only this particular rule will be broken as а result. However, when a quote is missing in a variable definition, it breaks all the rules that use this variable, exacerbating the mistake.

Currently, plumber does not react to imbalanced quotes, happily parsing definitions all the way through. Rejecting definitions with runaway quoted literals or at least reporting on those, would simplify debugging of plumbing rules that have a malformation like that.