Shader: Add support for logical and/or

This commit is contained in:
Jérôme Leclercq
2021-07-07 15:23:39 +02:00
parent ea899e4361
commit 72edff30c7
9 changed files with 192 additions and 76 deletions

View File

@@ -246,6 +246,34 @@ namespace Nz::ShaderLang
break;
}
case '|':
{
char next = Peek();
if (next == '|')
{
currentPos++;
tokenType = TokenType::LogicalOr;
}
else
throw UnrecognizedToken{}; //< TODO: Add BOR (a | b)
break;
}
case '&':
{
char next = Peek();
if (next == '&')
{
currentPos++;
tokenType = TokenType::LogicalAnd;
}
else
throw UnrecognizedToken{}; //< TODO: Add BAND (a & b)
break;
}
case '<':
{
char next = Peek();