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
BIL and Core Theory variable literals can contain only a specific
set of valid characters. Thus approach doesn't play nice with various
manglers and non-C languages as well as contradicts with our own
tradition as we generally tend to allow any character in variables,
see our Knowledge variables for example (and which are used underneath
the hood of CT and BIL variables).
One of the real-world examples where bap fails is the new C++ code
with lambdas, that uses `#` for anonymous variables.
In this proposal we allow any string (including the empty one) to be
used as a variable name. First of all, we escape any non-printable or
whitespace characters. We also escape '.' as we use it for variable
versioning. Next, if a prospective variable name starts from a digit,
is empty, or starts with `$` or `#` (which we use to encode de-bruijin
style variables) we prefix them with `_`.
Note, that escaping whitespaces and non-printable characters is really
not necessary, but helps with the textual representation of the
variable name, in case if we hit one.
0 commit comments