Skip to main content

is_compiler_written

Function is_compiler_written 

Source
pub fn is_compiler_written(name: &str) -> bool
Expand description

Is this a name the COMPILER wrote, rather than one the author typed?

★ AN AUTHOR CANNOT ACT ON A DIAGNOSTIC ABOUT CODE THEY DID NOT WRITE. Every LGX page lowers into synthesized functions — a dispatcher, a render, a turn — and an analysis that runs over the lowered program will happily report on those. It did: opening any page with a handler put two use-after-move errors in the editor about __lgx_sel, a dispatcher PARAMETER, spanning the whole file, advising the author to “Use Show instead”. A name they have never seen, at a place they cannot look, about a transfer they did not write.

The rule lives HERE, beside the functions that mint the names, for the same reason is_browser_only_lowering does: a consumer matching strings of its own would be a second spelling of a decision only this module makes, and it would fall out of step the first time a new family is added. This is the WIDER question of the two — __html_ is compiler-written and is not browser-only — so the two predicates are separate on purpose.