rust/src/libsyntax/ext
Björn Steinbrink 6c62d77830 Use an enum for keywords and intern them to improve parser performance
Currently, keywords are stored in hashsets that are recreated for every
Parser instance, which is quite expensive since macro expansion creates
lots of them. Additionally, the parser functions that look for a keyword
currently accept a string and have a runtime check to validate that they
actually received a keyword.

By creating an enum for the keywords and inserting them into the
ident interner, we can avoid the creation of the hashsets and get static
checks for the keywords.

For libstd, this cuts the parse+expansion part from ~2.6s to ~1.6s.
2013-05-25 17:57:22 +02:00
..
deriving syntax: Change syntax extensions to expand to std::foo instead of core::foo 2013-05-22 21:57:08 -07:00
pipes cleanup warnings from libsyntax 2013-05-23 17:57:07 -07:00
tt libextra: Rename the actual metadata names of libcore to libstd and libstd to libextra 2013-05-22 21:57:07 -07:00
asm.rs libextra: Rename the actual metadata names of libcore to libstd and libstd to libextra 2013-05-22 21:57:07 -07:00
auto_encode.rs syntax/ext: modernise ext_ctxt to be CamelCase and use new. 2013-05-22 00:04:10 +10:00
base.rs libextra: Rename the actual metadata names of libcore to libstd and libstd to libextra 2013-05-22 21:57:07 -07:00
build.rs libsyntax: Fix more merge fallout. 2013-05-22 21:57:11 -07:00
bytes.rs syntax/ext: convert all AstBuilder methods to a uniform syntax. 2013-05-22 00:30:52 +10:00
concat_idents.rs libextra: Rename the actual metadata names of libcore to libstd and libstd to libextra 2013-05-22 21:57:07 -07:00
env.rs libextra: Rename the actual metadata names of libcore to libstd and libstd to libextra 2013-05-22 21:57:07 -07:00
expand.rs syntax: Change syntax extensions to expand to std::foo instead of core::foo 2013-05-22 21:57:08 -07:00
fmt.rs libextra: Rename the actual metadata names of libcore to libstd and libstd to libextra 2013-05-22 21:57:07 -07:00
log_syntax.rs libextra: Rename the actual metadata names of libcore to libstd and libstd to libextra 2013-05-22 21:57:07 -07:00
quote.rs libextra: Rename the actual metadata names of libcore to libstd and libstd to libextra 2013-05-22 21:57:07 -07:00
source_util.rs libextra: Rename the actual metadata names of libcore to libstd and libstd to libextra 2013-05-22 21:57:07 -07:00
trace_macros.rs Use an enum for keywords and intern them to improve parser performance 2013-05-25 17:57:22 +02:00