You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This updates the inline assembly grammar description to use the grammar
style used in the rest of the reference, which also supports diagrams. I
also appreciate that this is more precisely defined using existing
grammar productions.
I realize that this is not as compressed as before. If that is a real
problem, then I think we can look at improving that throughout the
reference in general.
I did not change other parts of the chapter even though they mention
things like `in(<reg>) <expr>`. I could rewrite those, though I'm not
sure if that would help a lot.
There are restrictions not captured in the grammar which are explained
in the text. For example, global_asm and naked_asm do not allow
clobber_abi. I think I'm fine with the grammar not including everything
since there isn't the concept of an AST here.
This is not a direct translation because the old grammar was not
entirely precise or match with the existing grammar. This also renames
the rules to use PascalCase. The exhaustive list of differences:
Removed:
- Removed the `asm`, `naked_asm` and `global_asm` rules since I don't
think they really added anything, and the macro names aren't exactly
part of the grammar being described here. Instead it is just
`AsmArgs`.
- Removed the explicit `_` since that is now a normal Expression.
New:
- FormatString added MacroInvocation because that is supported.
- Defined RegisterClass.
- Defined ExplicitRegister.
Changed:
- Renamed option and options to AsmOption and AsmOptions, and operand to
AsmOperand (since our namespace is global).
- Clarified the meaning of "ident".
- ArgName allows ident, keywords, and raw identifiers.
- RegisterClass allows ident, keywords, but NOT raw identifiers.
- Split DirSpec into two, since there is a separate
`Expression => Expression` syntax that is only valid for a subset
of DirSpecs.
- Clarified that `sym` takes a PathExpression.
- Clarified that label's block doesn't allow inner attributes.
- Fixed sym/const/label which weren't properly quoted.
- Fixed some ambiguous precedence like alternation in reg_operand.
- Fixed `options` that it can be empty.
0 commit comments