mesa: allows 'f' suffix on GLSL float literals
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 10 Nov 2008 17:25:01 +0000 (10:25 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 6 Jan 2009 15:37:13 +0000 (08:37 -0700)
(cherry picked from commit 80c8017a643dfb655e4e1500e1c57e3908529c27)

src/mesa/shader/slang/library/slang_shader.syn
src/mesa/shader/slang/library/slang_shader_syn.h

index a95fa0df904d05edfb8f7917b74371985e20f959..cbfbda651af9bec1842ab3843f87b54130e0d562 100644 (file)
@@ -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;
 
index 86f6abe0245731032ca15aedca3dfd30173a06fc..f1fc9ca88336e7802c447764e8975000a72b566b 100644 (file)
 "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"
 " 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"