TiddlyWikiPharo/repository/TiddlyWiki/WikiTextGrammar.class.st

48 lines
788 B
Smalltalk
Raw Normal View History

Class {
#name : #WikiTextGrammar,
#superclass : #PP2CompositeNode,
#instVars : [
'document',
'link',
'linkOpen',
'linkContent',
'linkClose'
],
#category : #'TiddlyWiki-Model'
}
{ #category : #accessing }
WikiTextGrammar >> document [
^ link islandInSea star
]
{ #category : #accessing }
WikiTextGrammar >> link [
^ linkOpen, linkContent, linkClose ==> #second
]
{ #category : #accessing }
WikiTextGrammar >> linkClose [
^ ']]' asPParser
]
{ #category : #accessing }
WikiTextGrammar >> linkContent [
^ #any asPParser starLazy flatten
]
{ #category : #accessing }
WikiTextGrammar >> linkOpen [
^ '[[' asPParser
]
2021-08-16 14:46:14 +00:00
{ #category : #accessing }
WikiTextGrammar >> linkSea [
^ link sea ==> #second
]
{ #category : #accessing }
WikiTextGrammar >> start [
^ document
]