X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fparser.cpp;h=0512c10b235ea6d384d17e319d9a4a5ce3e5c7b2;hb=91e65bc9e24a6889995081035f6f6f0a78a6c20e;hp=6a055c0cd3ebb718830e65175efa15aa3bf10ca1;hpb=eb7ffda6876bd2eeeb64dcb7c82236f36fe5cf43;p=libs%2Fgl.git diff --git a/source/glsl/parser.cpp b/source/glsl/parser.cpp index 6a055c0c..0512c10b 100644 --- a/source/glsl/parser.cpp +++ b/source/glsl/parser.cpp @@ -72,6 +72,7 @@ void Parser::parse_source(const string &name, int index) declared_types.insert("void"); declared_types.insert("bool"); declared_types.insert("int"); + declared_types.insert("uint"); declared_types.insert("float"); } @@ -536,10 +537,14 @@ RefPtr Parser::parse_literal() if(isdigit(literal->token[0])) { // TODO have the tokenizer return the type of the token - if(isnumrc(literal->token)) - literal->value = lexical_cast(literal->token); - else + if(literal->token.back()=='u') + literal->value = lexical_cast(literal->token.substr(0, literal->token.size()-1)); + else if(literal->token.back()=='f') + literal->value = lexical_cast(literal->token.substr(0, literal->token.size()-1)); + else if(literal->token.find('.')!=string::npos) literal->value = lexical_cast(literal->token); + else + literal->value = lexical_cast(literal->token); } else if(literal->token=="true" || literal->token=="false") literal->value = (literal->token=="true");