summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-11-10 10:25:01 -0700
committerBrian Paul <[email protected]>2009-01-06 08:37:13 -0700
commitc478a1baca0d97b03f391361dfeb953939f245d4 (patch)
treeba84531808ccffb84fad53757082576984f69278 /src/mesa
parent45c8d996f606fbb0f42e3c87763eea6108b3bf28 (diff)
mesa: allows 'f' suffix on GLSL float literals
(cherry picked from commit 80c8017a643dfb655e4e1500e1c57e3908529c27)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/slang/library/slang_shader.syn12
-rw-r--r--src/mesa/shader/slang/library/slang_shader_syn.h10
2 files changed, 16 insertions, 6 deletions
diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn
index a95fa0df904..cbfbda651af 100644
--- a/src/mesa/shader/slang/library/slang_shader.syn
+++ b/src/mesa/shader/slang/library/slang_shader.syn
@@ -1393,11 +1393,13 @@ identifier
id_character_first .emit * .and .loop id_character_next .emit * .and .true .emit '\0';
float
- float_1 .or float_2;
+ float_1 .or float_2 .or float_3;
float_1
- float_fractional_constant .and float_optional_exponent_part;
+ float_fractional_constant .and float_optional_exponent_part .and optional_f_suffix;
float_2
- float_digit_sequence .and .true .emit '\0' .and float_exponent_part;
+ float_digit_sequence .and .true .emit '\0' .and float_exponent_part .and optional_f_suffix;
+float_3
+ float_digit_sequence .and .true .emit '\0' .and 'f' .emit '\0';
float_fractional_constant
float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;
@@ -1427,6 +1429,10 @@ float_optional_sign
float_sign
'+' .or '-' .emit '-';
+optional_f_suffix
+ 'f' .or .true;
+
+
integer
integer_hex .or integer_oct .or integer_dec;
diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h
index 86f6abe0245..f1fc9ca8833 100644
--- a/src/mesa/shader/slang/library/slang_shader_syn.h
+++ b/src/mesa/shader/slang/library/slang_shader_syn.h
@@ -671,11 +671,13 @@
"identifier\n"
" id_character_first .emit * .and .loop id_character_next .emit * .and .true .emit '\\0';\n"
"float\n"
-" float_1 .or float_2;\n"
+" float_1 .or float_2 .or float_3;\n"
"float_1\n"
-" float_fractional_constant .and float_optional_exponent_part;\n"
+" float_fractional_constant .and float_optional_exponent_part .and optional_f_suffix;\n"
"float_2\n"
-" float_digit_sequence .and .true .emit '\\0' .and float_exponent_part;\n"
+" float_digit_sequence .and .true .emit '\\0' .and float_exponent_part .and optional_f_suffix;\n"
+"float_3\n"
+" float_digit_sequence .and .true .emit '\\0' .and 'f' .emit '\\0';\n"
"float_fractional_constant\n"
" float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;\n"
"float_fractional_constant_1\n"
@@ -698,6 +700,8 @@
" float_sign .or .true;\n"
"float_sign\n"
" '+' .or '-' .emit '-';\n"
+"optional_f_suffix\n"
+" 'f' .or .true;\n"
"integer\n"
" integer_hex .or integer_oct .or integer_dec;\n"
"integer_hex\n"