Bug 29519 - [glsl2] Compiler should generate better diagnostics for use of reserved words
Summary: [glsl2] Compiler should generate better diagnostics for use of reserved words
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: All All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-11 16:12 UTC by Ian Romanick
Modified: 2010-08-11 17:09 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Ian Romanick 2010-08-11 16:12:43 UTC
At each version of GLSL there are a number of words reserved for future use (see section 3.6 in the GLSL spec).  The lexer processes these and generates tokens for them.  Upon encountering these tokens, the parse will generate error messages that are not useful.  For example, using the keyword "half" for a function name in a GLSL 1.10 shader results in the diagnostic:

error: 0:3(1): error: empty declaration list

A better message would be:

error: 0:3(1): error: invalid use of reserved word `half'
Comment 1 Ian Romanick 2010-08-11 17:09:56 UTC
Fixed by:

commit db36e88052918ad383c3acdd24f2b9864e240ddb
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Wed Aug 11 17:03:37 2010 -0700

    glsl2: Commit generated files changed by previous commit

commit 77215e7e7babe73e5d959ab5ad82054a8d73c538
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Wed Aug 11 17:01:31 2010 -0700

    glsl2: Emit error from lexer when illegal reserved word is encountered
    
    Without this, the parser will generate obtuse, useless error
    diagnostics when reservered word that are not used by the grammar are
    encountered in a shader.
    
    Fixes bugzilla #29519.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.