From aae1ba822b462bd2ce1e6285a60ef51b67d09a7a Mon Sep 17 00:00:00 2001 From: catamorphism Date: Tue, 8 May 2012 14:03:25 -0700 Subject: [PATCH] add first note --- Note-rustc-hacking-guide---front-end.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Note-rustc-hacking-guide---front-end.md diff --git a/Note-rustc-hacking-guide---front-end.md b/Note-rustc-hacking-guide---front-end.md new file mode 100644 index 0000000..5f84a21 --- /dev/null +++ b/Note-rustc-hacking-guide---front-end.md @@ -0,0 +1,5 @@ +The compiler front-end includes the lexer, parser and syntax extensions (macros), among other things. The front-end is in a separate crate, called ```syntax```, whose source files live in the ```src/librustsyntax``` directory under the main Rust source tree. (The middle and back end are in ```src/rustc```.) + +## Adding a new keyword + +If you need to add a new keyword to Rust (a rare occurrence, with hope!) edit one or the other of the functions ```contextual_keyword_table``` or ```restricted_keyword_table``` in ```src/librustsyntax/parse/token.rs```. Together, these functions construct the table that parser functions consult when determining which identifiers are keywords. \ No newline at end of file