#Macros
`macro_rules!` [IDENTIFIER] [MacroRulesDefinition]
#MacroRulesDefinition
`{` [MacroRules] `}` | `(` [MacroRules] `)``;` | `[` [MacroRules] `]``;`
#MacroRules
[MacroRule] "("`;`[MacroRule]")""*" `;`"?"
#MacroRule
[MacroMatcher] `=>` [MacroTranscriber]
#MacroMatcher
`(` [MacroMatches] `)` | `[` [MacroMatches] `]` | `{` [MacroMatches] `}`
#MacroMatches
[MacroMatch] "("`,`[MacroMatch]")""*"
#MacroMatch
/可以直接比对纯字面量/
Exclude<[Token], `$` | [DELIMITER]>
/指定每段的匹配模式,并捕获到元变量`$MetaVariable`/
| `$`[MetaVariable]`: `[MacroFragmentSpecifier]
/如需要进行多次匹配,可以指定分隔符和匹配次数/
| `$`"("[MacroMatch]"+"")" [MacroRepetitionSeparator]"?" [MacroRepetitionOperator]
| [MacroMatcher]
/元变量的命名规则/
#MetaVariable
Exclude<[IDENTIFIER] | [KEYWORD], `crate`> | [RAW_IDENTIFIER] | `_`
#MacroFragmentSpecifier
`block` | `expr` | `ident` | `item` | `lifetime` | `literal` | `meta` | `pat`
| `pat_param` | `path` | `stmt` | `tt` | `ty` | `vis`
#MacroRepetitionSeparator
Exclude<[Token], [DELIMITER] | [MacroRepetitionOperator]>
#MacroRepetitionOperator
`*` | `+` | `?`
#DELIMITER
`(` | `)` | `[` | `]` | `{` | `}`
#MacroTranscriber
[DelimTokenTree]
#DelimTokenTree
`(`[TokenTree]"*"`)` | `[`[TokenTree]"*"`]` | `{`[TokenTree]"*"`}`
#TokenTree
Exclude<[Token], [DELIMITER] | [DelimTokenTree]>
lakca/pseudo-code
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published