Skip to content

Commit

Permalink
Improve heuristic for detecting named instantiations
Browse files Browse the repository at this point in the history
Yes, this is merely a heuristic.
For example, `.local == .other` would still trip it,
but at least you can prevent it by wrapping the
expression in parentheses.
  • Loading branch information
ISSOtm committed Aug 17, 2024
1 parent 32e685b commit 6411ea3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion structs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ MACRO dstruct ; struct_type, instance_name[, ...]
; there because that would require a duplicated `ELSE`).
DEF IS_NAMED_INSTANTIATION = 0
IF _NARG > 2
REDEF IS_NAMED_INSTANTIATION = STRIN("\3", "=")
DEF IS_NAMED_INSTANTIATION = !STRCMP(STRSUB("\3", 1, 1), ".") && STRIN("\3", "=")
ENDC

IF IS_NAMED_INSTANTIATION
Expand Down

0 comments on commit 6411ea3

Please sign in to comment.