You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler/lexer.corth
+72-3Lines changed: 72 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -206,7 +206,6 @@ proc create-name-token
206
206
int ptr int ptr
207
207
208
208
// Checks if the name is a keyword or an intrinsic, and creates a new token.
209
-
// After the keyword and intrinsic checks, macros are checked for any match. If there is any macro with the same name, the macro tokens are loaded to a buffer.
210
209
in let file-name file start-position buffer buffer-end in
211
210
// Get full token.
212
211
file buffer buffer-end parse-next-token dup isn-null if
@@ -290,6 +289,57 @@ in let file-name file start-position buffer buffer-end in
// Checks if the name is a preprocessor and creates a new preprocessor token.
303
+
// After the keyword and intrinsic checks, macros are checked for any match. If there is any macro with the same name, the macro tokens are loaded to a buffer.
304
+
in let file-name file start-position buffer buffer-end in
305
+
// Get full token.
306
+
file buffer buffer-end parse-next-token dup isn-null if
307
+
let log-item in TOKEN-TYPE:UNKNOWN NULLPTR 0 log-item end return
308
+
end drop
309
+
310
+
buffer-end @64 buffer - let buffer-size in
311
+
// Check if the token is a preprocessor directive.
312
+
buffer buffer-size PREPROC-NAME:END memcmp8-wl is-zero if PREPROC:END
313
+
else buffer buffer-size PREPROC-NAME:IFDEF memcmp8-wl is-zero if PREPROC:IFDEF
314
+
else
315
+
// FUCKING UNREACHABLE CODE EXCEPTIONS!!!
316
+
true if
317
+
// Generate the address of the token.
318
+
file-name NULLPTR start-position file ftell generate-address let address in
0 commit comments