The behavior is defined only if the provided shading language code is a correct, self-contained code. The errors (like unterminated block) may only be detected after the complete shader is determined and compiled by the GPU. It should be noted that for shading languages with separate compilation units, the parsing errors can be at least reported always for the correct code piece (effect part).
An invalid effect code may disable all other user effects on the given shape. That is because there's no reliable way to detect which user effect prevents the compilation. At least for shading languages without the separate compilation units feature. In such case, the application may decide to disable all user-provided effects for a given shape. However, this isn't exactly a new problem — bad shader code may always cause enough trouble to prevent the shape from being sensibly rendered.
The application does not need to parse the shader code at any point. Only a trivial text search in the code is necessary to detect the magic plug function names and comments.