verified-network-toolchain / petr4

Petr4: Formal Semantics for P4
Apache License 2.0
75 stars 21 forks source link

Lexer hack for precedence of type argument lists #422

Closed hackedy closed 1 year ago

hackedy commented 1 year ago

The precedences of < as a binary operator and < as the left side of a type argument list e.g. extern_fun(...) have to be different. This PR adds a new token L_ANGLE_ARGS for the case where < is the start of a type argument list and uses a lexer hack to distinguish them based on the trick used in p4c's lexer.

This fixes #69