Skip to content

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
melkiyasser committed May 22, 2024
1 parent a48addd commit ccf4cc4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Microdown-ReferenceChecker/MicReferenceChecker.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Class {

{ #category : 'visiting' }
MicReferenceChecker >> attachFile: anElement [
"get the file from the root of the parsed tree to add it along the anchors later "

"get the file from the root of the parsed tree to add it along the anchors later so we know in what file are the anchors or elements that caused the problem , what worth noting here is in the cases where anchor is not an object that will not work "

|fakeElement|
fakeElement := anElement .
(anElement isKindOf: MicRootBlock )
Expand All @@ -33,17 +35,24 @@ MicReferenceChecker >> attachFile: anElement [

{ #category : 'visiting' }
MicReferenceChecker >> checkDir: aDir [

"take the directory , parse all its children with microdown file parser and let the visitor visit each time then return visitor is ok which should be true if every thing is okay , the visitor turned out to treat the many documents that it visits as one , so if anchor is duplicated in another file it will detect that . "

| parsedFile |

(aDir allFiles) do: [ :each |
(parsedFile := Microdown parseFile: (each contents)) accept: self .
].

^ self isOk

]

{ #category : 'visiting' }
MicReferenceChecker >> checkFile: aFile [

" will parse the given file and invite the visitor and return visitor isOk value "

|parsedFile|
parsedFile := Microdown parseFile: aFile contents .
parsedFile accept: self.
Expand Down

0 comments on commit ccf4cc4

Please sign in to comment.