PetitCommonMark/software/PetitMarkdown/PPCMPlainText.class.st

46 lines
772 B
Smalltalk

Class {
#name : 'PPCMPlainText',
#superclass : 'PPCMNode',
#instVars : [
'text'
],
#category : 'PetitMarkdown-AST'
}
{ #category : 'as yet unclassified' }
PPCMPlainText class >> empty [
^ self new
text: '';
yourself
]
{ #category : 'visiting' }
PPCMPlainText >> accept: visitor [
^ visitor visitPlainText: self
]
{ #category : 'converting' }
PPCMPlainText >> asString [
^ text
]
{ #category : 'printing' }
PPCMPlainText >> printOn: aStream [
super printOn: aStream.
aStream nextPut: $(.
aStream nextPut: $'.
text isNil ifFalse: [ aStream nextPutAll: text ].
aStream nextPut: $'.
aStream nextPut: $).
]
{ #category : 'accessing' }
PPCMPlainText >> text [
^ text
]
{ #category : 'accessing' }
PPCMPlainText >> text: anObject [
text := anObject
]