Fix an issue in the ShaderGenerator where it was unable to find the  main function in a shader source when there were additional spaces.
Also made the error more explicit when the matching fail.