PetitCommonMark/software/PetitMarkdown/PPCMLine.class.st

38 lines
673 B
Smalltalk

Class {
#name : 'PPCMLine',
#superclass : 'PPCMDelegateNode',
#category : 'PetitMarkdown-AST'
}
{ #category : 'as yet unclassified' }
PPCMLine class >> empty [
^ PPCMLine new
addChild: (PPCMText empty);
yourself
]
{ #category : 'visiting' }
PPCMLine >> accept: visitor [
^ visitor visitLine: self
]
{ #category : 'testing' }
PPCMLine >> isBlankLine [
^ self text = ''
]
{ #category : 'testing' }
PPCMLine >> isLine [
^ true
]
{ #category : 'visiting' }
PPCMLine >> text [
| stream |
"hackity hack, this should not be used except for tests..."
stream := WriteStream on: ''.
children do: [ :child | stream nextPutAll: child text ].
^ stream contents
]