Page MenuHomeFreeBSD

ddb(4): Add some support for lexing IPv6 addresses
ClosedPublic

Authored by cem on Tue, Sep 3, 5:27 PM.

Details

Summary

Allow commands to specify that (hex) numbers may start with A-F, by adding
the command-scoped CS_LEX_HEX flag. As before, numbers containing invalid
digits for the current radix are rejected.

Also, lex ':' and '::' tokens as tCOLON and tCOLONCOLON respectively.

There is a mild conflict here with lexed "identifiers" (tIDENT): ddb
identifiers may contain arbitrary colons, and the ddb lexer is greedy. So
the identifier lex will swallow any colons it finds inside identifiers, and
consumers are still unable to expect the token sequence 'tIDENT tCOLON'.
That limitation does not matter for IPv6 addresses, because the lexer always
attempts to lex numbers before identifiers.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

cem created this revision.Tue, Sep 3, 5:27 PM
cem updated this revision to Diff 61633.Wed, Sep 4, 12:25 AM

Switch to per-lex flags for the hexadecimal numbers mode (instead of a global).

markj accepted this revision.Sun, Sep 8, 4:01 PM
This revision is now accepted and ready to land.Sun, Sep 8, 4:01 PM
This revision was automatically updated to reflect the committed changes.