11use crate :: { PreprocessError , ShaderParameter } ;
22use librashader_common:: ImageFormat ;
33use nom:: bytes:: complete:: { is_not, tag, take_while} ;
4+ use nom:: Parser ;
45
56use librashader_common:: map:: ShortString ;
67use nom:: character:: complete:: { multispace0, multispace1} ;
@@ -22,7 +23,7 @@ fn parse_parameter_string(input: &str) -> Result<ShaderParameter, PreprocessErro
2223 let ( input, _) = tag ( "#pragma parameter " ) ( input) ?;
2324 let ( input, name) = take_while ( |c| c != ' ' && c != '\t' ) ( input) ?;
2425 let ( input, _) = multispace1 ( input) ?;
25- let ( input, description) = delimited ( tag ( "\" " ) , is_not ( "\" " ) , tag ( "\" " ) ) ( input) ?;
26+ let ( input, description) = delimited ( tag ( "\" " ) , is_not ( "\" " ) , tag ( "\" " ) ) . parse ( input) ?;
2627 let ( input, _) = multispace1 ( input) ?;
2728 Ok ( ( input, ( name, description) ) )
2829 }
@@ -46,7 +47,7 @@ fn parse_parameter_string(input: &str) -> Result<ShaderParameter, PreprocessErro
4647
4748 // https://github.com/libretro/slang-shaders/blob/0e2939787076e4a8a83be89175557fde23abe837/crt/shaders/crt-slangtest/parameters.inc#L1
4849 let ( input, _) = multispace0 ( input) ?;
49- let ( input, step) = opt ( float) ( input) ?;
50+ let ( input, step) = opt ( float) . parse ( input) ?;
5051 Ok ( (
5152 input,
5253 ShaderParameter {
0 commit comments