Skip to content

Commit

Permalink
Fix argument API
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducasse committed May 13, 2024
1 parent 06502d7 commit 5d94b2b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
15 changes: 11 additions & 4 deletions src/Microdown/MicArgumentList.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ MicArgumentList class >> split: aString defaultArg: defArg [
{ #category : 'instance creation' }
MicArgumentList class >> split: aString defaultArg: defArg defaultValue: defValue [
^ self new
defaultArg: defArg;
at: defArg put: defValue;
initialValue: defValue;
from: aString;
split: aString defaultArg: defArg defaultValue: defValue;
yourself
]

Expand Down Expand Up @@ -188,6 +185,16 @@ MicArgumentList >> setNoDefaultButArguments: string [

]

{ #category : 'initialization' }
MicArgumentList >> split: aString defaultArg: defArg defaultValue: defValue [

self
defaultArg: defArg;
at: defArg put: defValue;
initialValue: defValue;
from: aString
]

{ #category : 'copying' }
MicArgumentList >> withoutDefaultValue [
"remove the defaultArg if no new value was assigned to it"
Expand Down
8 changes: 8 additions & 0 deletions src/Microdown/MicEnvironmentBlock.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ MicEnvironmentBlock >> extractFirstLineFrom: aLine [
ifFalse: [ firstLine ]
]

{ #category : 'parse support' }
MicEnvironmentBlock >> initialize [

super initialize.
arguments := MicArgumentList new

]

{ #category : 'markups' }
MicEnvironmentBlock >> lineStartMarkup [

Expand Down
5 changes: 3 additions & 2 deletions src/Microdown/MicHeaderBlock.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ MicHeaderBlock >> formattedCode [
{ #category : 'accessing' }
MicHeaderBlock >> header [
"I am used to get an adhoc string for the header"
^ String streamContents: [ :s |
children do: [ :e | s nextPutAll: e bodystring ] ]

^ String streamContents: [ :s |
children do: [ :e | s nextPutAll: e bodyString ] ]
]

{ #category : 'accessing' }
Expand Down

0 comments on commit 5d94b2b

Please sign in to comment.