alecthomas / alecthomas/participle
Proposal: Support grammar aliases.
オープン
proposal
- 主要言語
- Go
- スター
- 3.9k
- フォーク
- 213
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
In moderately complex grammars it's fairly common to see duplicate patterns emerge. For example, when matching a dot-separated identifier (eg. `foo.bar`) the pattern `(Ident { "." Ident })` is used repeatedly. This can be handled by a Go type alias implementing the `Parseable` interface, but that is quite onerous.
I propose adding support for grammar aliases. Here's an example creating and using an `Identifier` alias:
```go
type Assignment struct {
Name string `@Identifier=(Ident { "." Ident })`
Variable string `"=" @Identifier`
}
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。