SDCC currently does not allow the use of keywords in attributes, e.g.
[[const::int]] i++;
will result in a compiler error.
However, the current C2X standard draft states " If a keyword (6.4.1) that satisfies the syntactic requirements of an identifier (6.4.2) is contained in an attribute token, it is considered an identifier."
I don't know how we should implement this in the parser / lexer.
Philipp
In same way as block comments and string literals, imho.
Attributes are more complicated:
Can it be parsed later? By separate parser for example.
I think that should be possible. Interaction between comments and attributes might still be a minor issue, but probably solveable.
Can a sequence of two opening brackets occur anywhere else?
I'm not sure, but I've never seen that in the wild.
Maybe one could turn them into a separate token.
I don't think there is another use for two subseqent opening brackets (unlike two subseqquent closing brackets, which is common).
Just keep in mind that the two brackets are not trivial to recognize, as there could be whitespace or comments in between them.
An arbitrary sequence of whitespace and comments would still be a regular language, though, wouldn't it?
It would.