PetitCommonMark/software/PetitMarkdown/PPContext.extension.st

71 lines
1.6 KiB
Smalltalk

Extension { #name : 'PPContext' }
{ #category : '*PetitMarkdown' }
PPContext >> codeFence [
^ self globalAt: #PPCMFence
]
{ #category : '*PetitMarkdown' }
PPContext >> codeFence: fence [
self globalAt: #PPCMFence put: fence
]
{ #category : '*PetitMarkdown' }
PPContext >> codeFenceIndent [
^ self globalAt: #PPCMFenceIndent
]
{ #category : '*PetitMarkdown' }
PPContext >> codeFenceIndent: indent [
self globalAt: #PPCMFenceIndent put: indent
]
{ #category : '*PetitMarkdown' }
PPContext >> inlineCodeEnd [
^ self globalAt: #inlineCodeEnd
]
{ #category : '*PetitMarkdown' }
PPContext >> inlineCodeEnd: value [
^ self globalAt: #inlineCodeEnd put: value
]
{ #category : '*PetitMarkdown' }
PPContext >> links [
^ self globalAt: #PPCMLinks ifAbsentPut: [ IdentitySet new ]
]
{ #category : '*PetitMarkdown' }
PPContext >> listItemStack [
^ self propertyAt: #listItemStack ifAbsentPut: [ Stack new ]
]
{ #category : '*PetitMarkdown' }
PPContext >> listItemType [
self listItemStack ifEmpty: [ ^ PPFailingParser message: 'stack is empty' ].
^ self listItemStack top
]
{ #category : '*PetitMarkdown' }
PPContext >> listItemType: value [
self listItemStack push: value
]
{ #category : '*PetitMarkdown' }
PPContext >> readLimit [
^ stream size
]
{ #category : '*PetitMarkdown' }
PPContext >> readLimit: limit [
stream readLimit: limit
]
{ #category : '*PetitMarkdown' }
PPContext >> registerLink: node [
self assert: node class == PPCMLinkRefDef.
(self links contains: [ :e | e label text asLowercase = node label text asLowercase ]) ifFalse: [
self links add: node
]
]