Shader: Add attribute and square bracket tokens (first step for attribute support)

This commit is contained in:
Jérôme Leclercq
2021-03-11 18:03:25 +01:00
parent 3f74ee4d66
commit 8135f22b2f
2 changed files with 26 additions and 0 deletions

View File

@@ -221,6 +221,28 @@ namespace Nz::ShaderLang
break;
}
case '[':
{
char next = Peek();
if (next == '[')
tokenType = TokenType::OpenAttribute;
else
tokenType = TokenType::OpenSquareBracket;
break;
}
case ']':
{
char next = Peek();
if (next == ']')
tokenType = TokenType::ClosingAttribute;
else
tokenType = TokenType::ClosingSquareBracket;
break;
}
case '=': tokenType = TokenType::Assign; break;
case '+': tokenType = TokenType::Plus; break;
case '*': tokenType = TokenType::Multiply; break;