-
Notifications
You must be signed in to change notification settings - Fork 19
Versions, editions, features #6
Comments
I think that the initial target should be "stable 1.31 edition 2018" or similar. We shouldn't worry about unstable parts of the grammar or edition switches for the first pass. (I think this was mentioned and suggested without argument in the first meeting.) |
From today's meeting: By "1.31" we mean the latest stable, not literally 1.31. |
Also from today's meeting: It is too early to think about unstable features and such. |
Quick thought: if we add rules like this: EDITION_2015 = ;
EDITION_2018 = ;
FEAT_CONST_GENERICS = ;
// etc. Then we can have (assuming rust-lang/gll#141 and Ident =
| IDENT
| EDITION_2015 "dyn"
// ...
; FnHeader = constness:"const"? asyncness:{ EDITION_2018 "async" }? unsafety:"unsafe"? { "extern" abi:Abi }?; GenericParamKind =
// ...
| Const:{ FEAT_CONST_GENERICS "const" name:IDENT ":" ty:Type }
; They will always succeed without consuming tokens, but they'll still be in resulting parse forest. So something neat we can then do, for a given parse result is find these to determine which editions/features a given input depends on. And we get But also, if both We could still treat treat that as a "parameterized grammar" by making some of the rules never succeed instead, and with the |
Is this actually true? My understanding is that we track editions on per-token basis, and that a given snippet of code might contain a mixture of tokens from different editions because of macros. |
@matklad Sure, but that's not something we can test in this repo, I was talking about the expansion-less situation. Still, we have access to the |
The text was updated successfully, but these errors were encountered: