Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

A more relaxed "level" of grammar? #67

Open
crlf0710 opened this issue Dec 1, 2019 · 3 comments
Open

A more relaxed "level" of grammar? #67

crlf0710 opened this issue Dec 1, 2019 · 3 comments

Comments

@crlf0710
Copy link
Member

crlf0710 commented Dec 1, 2019

Sometimes i feel that proc-macros should be given more chance to read and accept "fake" grammars, which allows it accept its own kinds of items and statements. This helps experiments on delegations and virtual structs and ideas like those.

@CAD97
Copy link
Contributor

CAD97 commented Dec 1, 2019

(Function like) Proc macros already accept an arbitrary token stream, though?

Sure, it is more difficult to parse something that is almost Rust than something that is Rust, as the latter case can just use syn, but anything that can be lexed by the Rust lexer can be accepted by proc macros.

So I don't know exactly what you're asking for. (I am working on a parser generator targeting syn::Parse and proc macros, though, which should make this much easier once it's reasonably usable.)

@Centril
Copy link
Contributor

Centril commented Dec 1, 2019

Is this specifically about procedural attribute macros, which are restricted to valid Rust AST constructs?

@crlf0710
Copy link
Member Author

crlf0710 commented Dec 1, 2019

Is this specifically about procedural attribute macros, which are restricted to valid Rust AST constructs?

Yes, sorry i didn't make it clear.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants