镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Support lex-style definitions #417

Open

Description

@FranklinChen

I didn't see a way to do the following that can be done in lex:

DIGIT    [0-9]
ID       [a-z][a-z0-9]*
NUMBER {DIGIT}+"."{DIGIT}*

%%

{NUMBER} ...

so that patterns can be composed in definitions and definitions can be used in rules.

Activity

  1. ltratt commented on Aug 30, 2023

    @ltratt
    Member

    Yes, this isn't currently supported. Given that we currently use the Rust regex crate, if we wanted to do something like this, we'd have some interesting fun and games getting escaping right. So a basic version is pretty easy; a version with good error messages might be challenging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions