Skip to content

Commit

Permalink
Merge pull request #484 from jecisc/extract-assignations-from-conditi…
Browse files Browse the repository at this point in the history
…onals

extract-assignations-from-conditionals
  • Loading branch information
Ducasse authored May 26, 2020
2 parents bb29cf8 + 5c81239 commit be9906b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
20 changes: 9 additions & 11 deletions src/Pillar-Chrysal/ConfigurationForPillar.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -277,21 +277,19 @@ ConfigurationForPillar >> convertLatexWriter: aValue [
{ #category : #conversion }
ConfigurationForPillar >> convertLevelSpecification: aValue [
"generated code"

| composite |
composite := PRTitlePrinterSpecification new.
aValue do: [:v |
"We ignore undeclared fields"
aValue
do: [ :v |
"We ignore undeclared fields"
(#(#level #renderAs #capitalization #numbering #headerSize) includes: v key asSymbol)
ifTrue: [
| value |
ifTrue: [ | value |
"if the element has been described we convert"
(self declaredItems includes: v key asSymbol)
ifTrue: [ value := self perform: (#convert, v key capitalized, ':') asSymbol with: v value ]
ifFalse: [ value := v value ].
composite
perform: (v key, ':') asSymbol
with: value].
].
value := (self declaredItems includes: v key asSymbol)
ifTrue: [ self perform: (#convert , v key capitalized , ':') asSymbol with: v value ]
ifFalse: [ v value ].
composite perform: (v key , ':') asSymbol with: value ] ].
^ composite
]

Expand Down
9 changes: 5 additions & 4 deletions src/Pillar-ExporterCore/PRTitlePrinterSpecification.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Class {
'printer',
'renderAs'
],
#category : 'Pillar-ExporterCore-Configuration'
#category : #'Pillar-ExporterCore-Configuration'
}

{ #category : #'accessing - defaults' }
Expand Down Expand Up @@ -100,9 +100,10 @@ PRTitlePrinterSpecification >> headerSize [
{ #category : #accessing }
PRTitlePrinterSpecification >> headerSize: anInteger [
"Pay attention changing the size only makes sense when numbering is true."
numbering
ifTrue: [ size := anInteger ]
ifFalse: [ size := 0 ].

size := numbering
ifTrue: [ anInteger ]
ifFalse: [ 0 ]
]

{ #category : #initialization }
Expand Down

0 comments on commit be9906b

Please sign in to comment.