Fixed parsing of OpenCL parameters with set array size.

This commit is contained in:
the_fiddler 2009-08-09 17:35:50 +00:00
parent bc469dcd46
commit 4633be3908

View file

@ -191,7 +191,7 @@ namespace CHeaderToXML
from item in line.Split("()".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[1].Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) from item in line.Split("()".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[1].Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
let tokens = item.Trim().Split(' ') let tokens = item.Trim().Split(' ')
let param_name = (tokens.Last().Trim() != "*/" ? tokens.Last() : tokens[tokens.Length - 2]).Trim() 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 param_type = (tokens.First().Trim() != "const" ? tokens.First().Trim() : tokens.Skip(1).First().Trim())
let has_array_size = array_size.IsMatch(param_name) let has_array_size = array_size.IsMatch(param_name)
let indirection_level = let indirection_level =
(from c in param_name where c == '*' select c).Count() + (from c in param_name where c == '*' select c).Count() +