[Mesa-dev] [PATCH] glcpp: Reject #version after the version has been resolved.

Carl Worth cworth at cworth.org
Thu Jan 30 14:24:57 PST 2014


Matt Turner <mattst88 at gmail.com> writes:
> +		if (parser->version_resolved) {
> +			glcpp_error(& @1, parser, "#version after
> version is resolved");

The phrasing "after version is resolved" makes a lot of sense from the
point-of-view of the implementation, but it's not ideal for guiding the
user to a solution.

Perhaps better would be something like:

	#version must be on first line

You might come up with better wording, still. I don't know if it's worth
trying to clarify that comment lines or blank lines can appear before
#version.

It would also be possible to distinguish a separate "Duplicate #version"
error case, but that would require additional state in the parser so is
likely not worth it. And the "first line" wording should guide the user
appropriately even if there are duplicate #version directives.

Regardless of the specific wording finally chosen:

Reviewed-by: Carl Worth <cworth at cworth.org>

-Carl

-- 
carl.d.worth at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140130/98fd9786/attachment.pgp>


More information about the mesa-dev mailing list