McStasMcXtrace / mccode-antlr

McCode grammar implemented with ANTLR4
1 stars 0 forks source link

[Fix] LocalRegistry known/fullname glob inconsistency #80

Closed g5t closed 1 month ago

g5t commented 1 month ago

The Reader asks each Registry in turn if it 'knows' a filename. If it does, that Registry is then used to retrieve the file 'fullname', 'path', or contents. In the case of LocalRegistry the component is searched for in a more-restrictive way for the three latter cases, allowing for the possibility that a LocalRegistry 'knows' it has a file but can't find it.

This makes the later checks less stringent, fixing #79, which could have the effect of allowing multiple matches for a file, especially if two copies of the same file (with modifications, presumably) exist in the same directory tree.

For now, this possible drawback is not blocking, since if there is a directory structure like

/
├ backup
│   └ ComponentA
│       └ ComponentA.instr
└ ComponentA
    └ ComponentA.instr

outside of the runtime directory, then one could specify -I /ComponentA or -I /backup/ComponentA (instead of -I /) to get just one copy of the same-named file in the LocalRegistry. And a similar layout under the runtime directory would require moving or renaming of files.