-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
Description
I have the impression that
replaceCurrentNodeBy: newNodes
"When we do a transformation I replace the current node by its transformation."
replacement pop.
replacement push: newNodes
should be written as
replaceCurrentNodeBy: newNodes
"When we do a transformation I replace the current node by its transformation."
| replaced |
replacedParent := replacement pop.
newNodes do: [ :each | each basicParent: replacedParent ].
replacement push: newNodes
Imagine we have
Root
Element
inputFile
with inputFile
RootOfFile1
Header1
where tab expressed parent reference
after include
We get
Root
Element
RootOfFile1
RootOfFIle1 should be Root
This is a problem because it means that we can lose the way to resolve references using fromFile which is shared in top element.
Should
- write a couple test to verify this hypothesis.
- Tests could be at the level of the replaceCurrentNodeBy:
- Tests could be at the level of the MicFileIncluder
ast := Microdown parseFile: '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks2/BuildingApplicationWithSpec2/index.md' asFileReference.
MicFileIncluder new topFile: '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks2/BuildingApplicationWithSpec2/index.md' asFileReference;
expandAllInputOf: ast.