From bc469dcd460037e71678d9b861c668633182f9bf Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 9 Aug 2009 17:13:34 +0000 Subject: [PATCH] Fixed parsing of pointer types in 'cl.h' (parameter types and pointers are separated by a space, i.e. 'char **'). --- Source/Converter/CHeaderToXML/ESCLParser.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Converter/CHeaderToXML/ESCLParser.cs b/Source/Converter/CHeaderToXML/ESCLParser.cs index 6c6e4992..1259758a 100644 --- a/Source/Converter/CHeaderToXML/ESCLParser.cs +++ b/Source/Converter/CHeaderToXML/ESCLParser.cs @@ -193,7 +193,13 @@ namespace CHeaderToXML let param_name = (tokens.Last().Trim() != "*/" ? tokens.Last() : tokens[tokens.Length - 2]).Trim() let param_type = (tokens.First().Trim() != "const" ? tokens.First().Trim() : tokens[tokens.Length - 2]).Trim() let has_array_size = array_size.IsMatch(param_name) - let indirection_level = (from c in param_name where c == '*' select c).Count() + (from c in param_type where c == '*' select c).Count() + (has_array_size ? 1 : 0) + let indirection_level = + (from c in param_name where c == '*' select c).Count() + + (from c in param_type where c == '*' select c).Count() + + (from t in tokens where t == "***" select t).Count() * 3 + + (from t in tokens where t == "**" select t).Count() * 2 + + (from t in tokens where t == "*" select t).Count() + + (has_array_size ? 1 : 0) let pointers = new string[] { "*", "*", "*", "*" } // for adding indirection levels (pointers) to param_type where tokens.Length > 1 select new