Skip to content

scanner: verify that names are valid C identifiers

M. Stoeckl requested to merge mstoeckl/wayland:scanner-validation into master

This mostly resolves #24 (closed). The wayland_scanner code now checks that names in XML protocol files only have letters that are [_0-9a-zA-Z] or unicode, and that names which may form the prefix of an identifier do not begin with a number.

For simplicity, I did not handle edge cases like checking /which/ unicode values are permitted in identifiers by the newer C standards, or conditionally filtering out the list of 30+ reserved words.

A single test was added to confirm that a bad identifier name will produce an error.

This is WIP because the new test is failing in the pipeline.

Edit: Unicode characters now produce errors instead of warnings.

Edited by M. Stoeckl

Merge request reports