diff options
author | John Hodge <tpg@mutabah.net> | 2016-11-03 13:33:27 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-11-03 13:33:27 +0800 |
commit | c5e1771361db01b790dc26c3f670eceb80c50939 (patch) | |
tree | e5e7f275cf9c0b37511258ef0dee10716189fee7 /Notes | |
parent | 01dc9ba84fab3200d3db551857e40f9df7c2fcac (diff) | |
download | mrust-c5e1771361db01b790dc26c3f670eceb80c50939.tar.gz |
Notes/Hygiene - Fix spelling and match implementation
Diffstat (limited to 'Notes')
-rw-r--r-- | Notes/MacroHygine.md | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Notes/MacroHygine.md b/Notes/MacroHygine.md index e0f5c99b..972e7cc1 100644 --- a/Notes/MacroHygine.md +++ b/Notes/MacroHygine.md @@ -1,6 +1,6 @@ -% Macro Hygine rules and notes +% Macro Hygiene rules and notes -Usecases +Use-cases ========= A variable defined within the macro won't collide with one in a capture @@ -43,7 +43,7 @@ fn bar() { } ``` -Implementaton Notes +Implementation Notes =================== Idea 1: Index list @@ -51,14 +51,14 @@ Idea 1: Index list Lexer maintains a stack of counts - incremented after every TT end (closing bracket) and for every IDENT lexed. The stack grows into each TT. -This stack is the hygine information for an identifier. During lookup a symbol is only usable if its hygine information is a superset or before yours. +This stack is the hygiene information for an identifier. During lookup a symbol is only usable if its hygiene information is a superset or before yours. ``` -if( item_hygine[..-1].is_subset_of(my_hygine) && item_hygine[-1] < my_hygine[item_hygine.len] ) { +if( item_hygine[..-1].is_subset_of(my_hygine) && item_hygiene[-1] < my_hygiene[item_hygiene.len] ) { /* allowed */ } ``` -Hygine storage points: +Hygiene storage points: - Relative paths (of the leading node) - Pattern bindings (variable definitions) - _TODO: Where else?_ @@ -66,14 +66,14 @@ Hygine storage points: - Items? (when would that be checked? They're "globally" addressable) -Problem: Destructuring patterns end up with an incorrect hygine using this system. +Problem: Destructuring patterns end up with an incorrect hygiene using this system. -Idea 2: Hygine is directly related to the parser state +Idea 2: Hygiene is directly related to the parser state -------------------------- -- Each lexer has a hygine tag -- Token trees carry with them the hygine tag for the contained tokens -- :ident captures Ident as TOK_INTERPOLATED_IDENT +- Each lexer has a hygiene tag +- Token trees carry with them the hygiene tag for the contained tokens +- :ident captures a TT with associated hygiene context <!-- vim: ft=markdown |