| ... | ... | @@ -278,62 +278,62 @@ pub const Token = struct { |
| 278 | 278 | |
| 279 | 279 | // TODO extensions |
| 280 | 280 | pub const keywords = std.ComptimeStringMap(Id, .{ |
| 281 | | .{"auto", .Keyword_auto}, |
| 282 | | .{"break", .Keyword_break}, |
| 283 | | .{"case", .Keyword_case}, |
| 284 | | .{"char", .Keyword_char}, |
| 285 | | .{"const", .Keyword_const}, |
| 286 | | .{"continue", .Keyword_continue}, |
| 287 | | .{"default", .Keyword_default}, |
| 288 | | .{"do", .Keyword_do}, |
| 289 | | .{"double", .Keyword_double}, |
| 290 | | .{"else", .Keyword_else}, |
| 291 | | .{"enum", .Keyword_enum}, |
| 292 | | .{"extern", .Keyword_extern}, |
| 293 | | .{"float", .Keyword_float}, |
| 294 | | .{"for", .Keyword_for}, |
| 295 | | .{"goto", .Keyword_goto}, |
| 296 | | .{"if", .Keyword_if}, |
| 297 | | .{"int", .Keyword_int}, |
| 298 | | .{"long", .Keyword_long}, |
| 299 | | .{"register", .Keyword_register}, |
| 300 | | .{"return", .Keyword_return}, |
| 301 | | .{"short", .Keyword_short}, |
| 302 | | .{"signed", .Keyword_signed}, |
| 303 | | .{"sizeof", .Keyword_sizeof}, |
| 304 | | .{"static", .Keyword_static}, |
| 305 | | .{"struct", .Keyword_struct}, |
| 306 | | .{"switch", .Keyword_switch}, |
| 307 | | .{"typedef", .Keyword_typedef}, |
| 308 | | .{"union", .Keyword_union}, |
| 309 | | .{"unsigned", .Keyword_unsigned}, |
| 310 | | .{"void", .Keyword_void}, |
| 311 | | .{"volatile", .Keyword_volatile}, |
| 312 | | .{"while", .Keyword_while}, |
| 281 | .{ "auto", .Keyword_auto }, |
| 282 | .{ "break", .Keyword_break }, |
| 283 | .{ "case", .Keyword_case }, |
| 284 | .{ "char", .Keyword_char }, |
| 285 | .{ "const", .Keyword_const }, |
| 286 | .{ "continue", .Keyword_continue }, |
| 287 | .{ "default", .Keyword_default }, |
| 288 | .{ "do", .Keyword_do }, |
| 289 | .{ "double", .Keyword_double }, |
| 290 | .{ "else", .Keyword_else }, |
| 291 | .{ "enum", .Keyword_enum }, |
| 292 | .{ "extern", .Keyword_extern }, |
| 293 | .{ "float", .Keyword_float }, |
| 294 | .{ "for", .Keyword_for }, |
| 295 | .{ "goto", .Keyword_goto }, |
| 296 | .{ "if", .Keyword_if }, |
| 297 | .{ "int", .Keyword_int }, |
| 298 | .{ "long", .Keyword_long }, |
| 299 | .{ "register", .Keyword_register }, |
| 300 | .{ "return", .Keyword_return }, |
| 301 | .{ "short", .Keyword_short }, |
| 302 | .{ "signed", .Keyword_signed }, |
| 303 | .{ "sizeof", .Keyword_sizeof }, |
| 304 | .{ "static", .Keyword_static }, |
| 305 | .{ "struct", .Keyword_struct }, |
| 306 | .{ "switch", .Keyword_switch }, |
| 307 | .{ "typedef", .Keyword_typedef }, |
| 308 | .{ "union", .Keyword_union }, |
| 309 | .{ "unsigned", .Keyword_unsigned }, |
| 310 | .{ "void", .Keyword_void }, |
| 311 | .{ "volatile", .Keyword_volatile }, |
| 312 | .{ "while", .Keyword_while }, |
| 313 | 313 | |
| 314 | 314 | // ISO C99 |
| 315 | | .{"_Bool", .Keyword_bool}, |
| 316 | | .{"_Complex", .Keyword_complex}, |
| 317 | | .{"_Imaginary", .Keyword_imaginary}, |
| 318 | | .{"inline", .Keyword_inline}, |
| 319 | | .{"restrict", .Keyword_restrict}, |
| 315 | .{ "_Bool", .Keyword_bool }, |
| 316 | .{ "_Complex", .Keyword_complex }, |
| 317 | .{ "_Imaginary", .Keyword_imaginary }, |
| 318 | .{ "inline", .Keyword_inline }, |
| 319 | .{ "restrict", .Keyword_restrict }, |
| 320 | 320 | |
| 321 | 321 | // ISO C11 |
| 322 | | .{"_Alignas", .Keyword_alignas}, |
| 323 | | .{"_Alignof", .Keyword_alignof}, |
| 324 | | .{"_Atomic", .Keyword_atomic}, |
| 325 | | .{"_Generic", .Keyword_generic}, |
| 326 | | .{"_Noreturn", .Keyword_noreturn}, |
| 327 | | .{"_Static_assert", .Keyword_static_assert}, |
| 328 | | .{"_Thread_local", .Keyword_thread_local}, |
| 322 | .{ "_Alignas", .Keyword_alignas }, |
| 323 | .{ "_Alignof", .Keyword_alignof }, |
| 324 | .{ "_Atomic", .Keyword_atomic }, |
| 325 | .{ "_Generic", .Keyword_generic }, |
| 326 | .{ "_Noreturn", .Keyword_noreturn }, |
| 327 | .{ "_Static_assert", .Keyword_static_assert }, |
| 328 | .{ "_Thread_local", .Keyword_thread_local }, |
| 329 | 329 | |
| 330 | 330 | // Preprocessor directives |
| 331 | | .{"include", .Keyword_include}, |
| 332 | | .{"define", .Keyword_define}, |
| 333 | | .{"ifdef", .Keyword_ifdef}, |
| 334 | | .{"ifndef", .Keyword_ifndef}, |
| 335 | | .{"error", .Keyword_error}, |
| 336 | | .{"pragma", .Keyword_pragma}, |
| 331 | .{ "include", .Keyword_include }, |
| 332 | .{ "define", .Keyword_define }, |
| 333 | .{ "ifdef", .Keyword_ifdef }, |
| 334 | .{ "ifndef", .Keyword_ifndef }, |
| 335 | .{ "error", .Keyword_error }, |
| 336 | .{ "pragma", .Keyword_pragma }, |
| 337 | 337 | }); |
| 338 | 338 | |
| 339 | 339 | // TODO do this in the preprocessor |