Library can now construct into AST and serialization itself (singleheader).

Still need to validate if they match.
This commit is contained in:
2023-08-04 16:12:13 -04:00
parent d36c3fa847
commit 34f286d218
23 changed files with 200 additions and 123 deletions

View File

@ -812,8 +812,13 @@ CodeOperator def_operator( OperatorT op, StrC nspace
return CodeInvalid;
}
char const* name = str_fmt_buf( "%.*soperator %s", nspace.Len, nspace.Ptr, to_str(op) );
char const* name = nullptr;
StrC op_str = to_str( op );
if ( nspace.Len > 0 )
name = str_fmt_buf( "%.*soperator %.*s", nspace.Len, nspace.Ptr, op_str.Len, op_str.Ptr );
else
name = str_fmt_buf( "operator %.*s", op_str.Len, op_str.Ptr );
CodeOperator
result = (CodeOperator) make_code();
result->Name = get_cached_string( { str_len(name), name } );