glsl: Fix absurd whitespace conventions in the parser.

Historically, we indented grammar production rules with a single 8-space
tab, but code inside of blocks used Mesa's 3-space indents.

This meant when editing code, you had to use an 8-space tab for the
first level of indentation, and 3-spaces after that.  Unless you
specifically configure your editor to understand this, it will get the
indentation wrong on every single line you touch, which quickly devolves
into a colossal waste of time.

It's also inconsistent with every other file in the entire project.

This patch removes all tabs and moves to a consistent 3-space indent.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
This commit is contained in:
Kenneth Graunke
2013-07-13 14:44:45 -07:00
parent 4ab7fc9ec3
commit 00d32cd5b4

View File

@@ -1514,19 +1514,19 @@ basic_type_specifier_nonarray:
; ;
precision_qualifier: precision_qualifier:
HIGHP { HIGHP
{
state->check_precision_qualifiers_allowed(&@1); state->check_precision_qualifiers_allowed(&@1);
$$ = ast_precision_high; $$ = ast_precision_high;
} }
| MEDIUMP { | MEDIUMP
{
state->check_precision_qualifiers_allowed(&@1); state->check_precision_qualifiers_allowed(&@1);
$$ = ast_precision_medium; $$ = ast_precision_medium;
} }
| LOWP { | LOWP
{
state->check_precision_qualifiers_allowed(&@1); state->check_precision_qualifiers_allowed(&@1);
$$ = ast_precision_low; $$ = ast_precision_low;
} }
; ;
@@ -2092,20 +2092,17 @@ instance_name_opt:
/* empty */ /* empty */
{ {
$$ = new(state) ast_interface_block(*state->default_uniform_qualifier, $$ = new(state) ast_interface_block(*state->default_uniform_qualifier,
NULL, NULL, NULL);
NULL);
} }
| NEW_IDENTIFIER | NEW_IDENTIFIER
{ {
$$ = new(state) ast_interface_block(*state->default_uniform_qualifier, $$ = new(state) ast_interface_block(*state->default_uniform_qualifier,
$1, $1, NULL);
NULL);
} }
| NEW_IDENTIFIER '[' constant_expression ']' | NEW_IDENTIFIER '[' constant_expression ']'
{ {
$$ = new(state) ast_interface_block(*state->default_uniform_qualifier, $$ = new(state) ast_interface_block(*state->default_uniform_qualifier,
$1, $1, $3);
$3);
} }
| NEW_IDENTIFIER '[' ']' | NEW_IDENTIFIER '[' ']'
{ {
@@ -2113,8 +2110,7 @@ instance_name_opt:
"instance block arrays must be explicitly sized\n"); "instance block arrays must be explicitly sized\n");
$$ = new(state) ast_interface_block(*state->default_uniform_qualifier, $$ = new(state) ast_interface_block(*state->default_uniform_qualifier,
$1, $1, NULL);
NULL);
} }
; ;
@@ -2159,8 +2155,7 @@ member_declaration:
layout_defaults: layout_defaults:
layout_qualifier UNIFORM ';' layout_qualifier UNIFORM ';'
{ {
if (!state->default_uniform_qualifier->merge_qualifier(& @1, state, if (!state->default_uniform_qualifier->merge_qualifier(& @1, state, $1)) {
$1)) {
YYERROR; YYERROR;
} }
} }