Bugfixes during hiatus

Found while doing some metaprogramming for day 42 of handmade hero.
This commit is contained in:
2023-10-22 21:41:36 -04:00
parent 3dd5482a46
commit 912cc6b538
6 changed files with 82 additions and 52 deletions

View File

@ -775,6 +775,18 @@ namespace Parser
if (left)
move_forward();
if ( current == '=' )
{
token.Length++;
token.IsAssign = true;
// token.Flags |= TokFlags::Assignment;
// token.Type = TokType::Assign_Multiply;
if ( left )
move_forward();
}
goto FoundToken;
}
case ';':
@ -973,7 +985,14 @@ namespace Parser
if ( left )
{
if ( current == '/' )
if ( current == '=' )
{
// token.Type = TokeType::Assign_Divide;
move_forward();
token.Length++;
token.IsAssign = true;
}
else if ( current == '/' )
{
token.Type = TokType::Comment;
token.Length = 2;
@ -2820,7 +2839,7 @@ CodeOperator parse_operator_after_ret_type(
if ( currtok.Text[1] == '=' )
op = Assign_Add;
if ( currtok.Text[1] == '+' )
else if ( currtok.Text[1] == '+' )
op = Increment;
else
@ -2840,7 +2859,7 @@ CodeOperator parse_operator_after_ret_type(
break;
}
if ( currtok.Text[1] == '=' )
else if ( currtok.Text[1] == '=' )
op = Assign_Subtract;
else
@ -3196,6 +3215,12 @@ CodeParam parse_params( bool use_template_capture )
Context.pop();
return { nullptr };
}
else if ( check ( TokType::Operator ) && currtok.Text[0] == '>' )
{
eat( TokType::Operator );
Context.pop();
return { nullptr };
}
CodeType type = { nullptr };
Code value = { nullptr };