mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-05 15:18:46 +00:00
progress on compiler errors
This commit is contained in:
+3
-3
@@ -687,7 +687,7 @@ parse_from_text_tokens(Arena* arena, String8 filename, String8 text, TokenArray
|
||||
|
||||
// TODO(Ed): Add opt-in support for comment awareness
|
||||
//- rjf: comments -> always no-op & inc
|
||||
if (token->flags & TokenGroup_Comment) {
|
||||
if (token->flags & TokenFlagGroup_Comment) {
|
||||
token += 1;
|
||||
goto end_consume;
|
||||
// < // > <content> <unescaped newline>
|
||||
@@ -763,7 +763,7 @@ parse_from_text_tokens(Arena* arena, String8 filename, String8 text, TokenArray
|
||||
if (mode_main_or_main_implict && found_tag)
|
||||
{
|
||||
// Token after should be label.
|
||||
if (token + 1 >= tokens_opl || !(token[1].flags & TokenGroup_Label))
|
||||
if (token + 1 >= tokens_opl || !(token[1].flags & TokenFlagGroup_Label))
|
||||
{
|
||||
Node* error = push_node(arena, NodeKind_ErrorMarker, 0, token_string, token_string, token->range.min);
|
||||
String8 error_string = str8_lit("Tag label expected after @ symbol.");
|
||||
@@ -797,7 +797,7 @@ parse_from_text_tokens(Arena* arena, String8 filename, String8 text, TokenArray
|
||||
}
|
||||
|
||||
//- rjf: [main, main_implicit] label -> create new main
|
||||
if (mode_main_or_main_implict && token->flags & TokenGroup_Label)
|
||||
if (mode_main_or_main_implict && token->flags & TokenFlagGroup_Label)
|
||||
{
|
||||
String8 node_string_raw = token_string;
|
||||
String8 node_string = content_string_from_token_flags_str8(token->flags, node_string_raw);
|
||||
|
||||
+10
-10
@@ -1,6 +1,5 @@
|
||||
#if INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "base/base.h"
|
||||
# include "os/os.h"
|
||||
#endif
|
||||
|
||||
@@ -70,15 +69,15 @@ enum
|
||||
TokenFlag_BadCharacter = (1 << 14),
|
||||
};
|
||||
|
||||
typedef U32 TokenGroups;
|
||||
typedef U32 TokenFlagGroups;
|
||||
enum
|
||||
{
|
||||
TokenGroup_Comment = TokenFlag_Comment,
|
||||
TokenGroup_Whitespace = (TokenFlag_Whitespace| TokenFlag_Newline),
|
||||
TokenGroup_Irregular = (TokenGroup_Comment | TokenGroup_Whitespace),
|
||||
TokenGroup_Regular = ~TokenGroup_Irregular,
|
||||
TokenGroup_Label = (TokenFlag_Identifier | TokenFlag_Numeric | TokenFlag_StringLiteral | TokenFlag_Symbol),
|
||||
TokenGroup_Error = (TokenFlag_BrokenComment | TokenFlag_BrokenStringLiteral | TokenFlag_BadCharacter),
|
||||
TokenFlagGroup_Comment = TokenFlag_Comment,
|
||||
TokenFlagGroup_Whitespace = (TokenFlag_Whitespace| TokenFlag_Newline),
|
||||
TokenFlagGroup_Irregular = (TokenFlagGroup_Comment | TokenFlagGroup_Whitespace),
|
||||
TokenFlagGroup_Regular = ~TokenFlagGroup_Irregular,
|
||||
TokenFlagGroup_Label = (TokenFlag_Identifier | TokenFlag_Numeric | TokenFlag_StringLiteral | TokenFlag_Symbol),
|
||||
TokenFlagGroup_Error = (TokenFlag_BrokenComment | TokenFlag_BrokenStringLiteral | TokenFlag_BadCharacter),
|
||||
};
|
||||
|
||||
typedef struct Token Token;
|
||||
@@ -228,8 +227,9 @@ struct ParseResult
|
||||
inline Node*
|
||||
nil_node()
|
||||
{
|
||||
read_only thread_local local_persist
|
||||
nil = {
|
||||
read_only local_persist
|
||||
Node nil =
|
||||
{
|
||||
&nil,
|
||||
&nil,
|
||||
&nil,
|
||||
|
||||
Reference in New Issue
Block a user