Skip to content

#include('path/to/anther') feature request #4840

Open
@deerchao

Description

@deerchao

It would be nice to have a way to include another file. For example:

lexer grammar Keywords;

NEW: 'new';
NULL: 'null';
lexer grammar IdentifierLexer;

import Keywords;

Identifier: [a-zA-Z]+;

Then 'new' and 'null' would be recognized as not keywords but Identifier.

This is because the imported grammars are placed after all current rules, but sometimes we need it before or even in the middle of current rule set. It would be useful to have a way to just include another grammar file in place, just like #include "file" in C.

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