Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

TokenizedString duplicates can occur #401

@markfinal

Description

@markfinal

Spotted this in BAM v120 (prior to introducing Bam.Core.TokenizedStringArray.ToEnumerableWithoutDuplicates), when compiling the executable in Test13.

When two modules of the same package have the same expression that is based on a package-specific macro, e.g. $(packagedir), then 1) the parsed strings are identical, but 2) the hashes of the individual strings are different, because the modules are different.

Things I have thought about for fixing this:

  1. introduce another source of macros, in the PackageDefinition, which defines per-package TokenizedStrings
  2. do a pre-pass through macroized TokenizedStrings, in an attempt to turn macro references, e.g. $(packagedir) into a positional argument. If this can happen fully, then the modulewithmacros is no longer needed, and strings ought to have identical hashes after.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions