Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype for support of custom keywords #480

Closed
wants to merge 1 commit into from

Commits on Sep 4, 2018

  1. Prototype for support of custom keywords

    First prototype for support of custom keywords with syn's new parsing
    API. Documentation and tests aren't present for now as I'm mainly
    reaching for feedback.
    
    This patch introduces a new Keyword trait, a new macro custom_keyword!
    and exposes the existing TokenMarker enum. The Keyword trait
    automatically implements the Token trait, making it possible to peek on
    custom keywords (this is why I had to make TokenMarker public).
    
    The custom macro generates a structure storing an Ident and implementing
    the Keyword and Parse traits. A function with the same name as the
    structure is also generated in order to use it like any predefined
    keyword.
    kureuil committed Sep 4, 2018
    Configuration menu
    Copy the full SHA
    c0beaf3 View commit details
    Browse the repository at this point in the history