Closed darylwright closed 1 year ago
Can you give me some examples of where specifically you are getting circular dependencies? Will make it easier for me to restructure it in a useful way!
I encountered this issue while trying to create new lexing modes and tokens. It's a bit difficult to describe, but I'm close to completing some work on this that I'll issue a PR for. You can take those changes or modify my approach if you had something different in mind.
I'm submitting a ... [ ] bug report [ * ] feature request [ ] question about the decisions made in the repository [ ] question about how to use this project
Summary
The current file structure for the lexer tokens and modes are prone to circular imports. When a circular import occurs, a module is referenced before its exports are defined, causing
undefined
to show up when not intended. The consequence of this issue is seen most easily during testing, when tests fail due to accesses onundefined
.Resolving this issue will make it easier to implement the remainder of the hledger spec, as we would not have to develop around the possibility of circular imports.