aboutsummaryrefslogtreecommitdiff
path: root/def.peg
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-05-23 07:07:04 +0200
committerJonas Smedegaard <dr@jones.dk>2025-05-23 07:07:04 +0200
commit7e56c94c03727894dec1b65da923bb4bd532df52 (patch)
treed964a2fc96af99b43133eacb046910e9d2bfff20 /def.peg
parentc137bb34cf4f5875e6b959e5563dd37c0f1638bc (diff)
move syntax diagrams to subdir
Diffstat (limited to 'def.peg')
-rw-r--r--def.peg56
1 files changed, 0 insertions, 56 deletions
diff --git a/def.peg b/def.peg
deleted file mode 100644
index e40610f..0000000
--- a/def.peg
+++ /dev/null
@@ -1,56 +0,0 @@
-# Subsets of Markdown syntax structure
-# expressed in parsing expression grammar (PEG) notation.
-#
-# Copyright 2025, Jonas Smedegaard <dr@jones.dk>
-# SPDX-License-Identifier: GPL-3+
-
-# Document
-Markdown <- ('---' NEWLINE MetaBlock* '---' NEWLINE)? Block*
-
-# Block elements
-Block <- Header
- / List
- / LinkDefinition
- / Paragraph
-Header <- '#'+ SPACE* !NEWLINE Words? SPACE* NEWLINE
-List <- ([-*]+ / [[:digit:]]+ [).]) (_ (List / Words))? NEWLINE
-LinkDefinition <- LinkLabel ':' _? Uri (_ LinkTitle)? NEWLINE
-Paragraph <- Words (HardBreak Words)* NEWLINE+
-
-# Inline elements
-Words <- StyledWords
- / LinkedWords
- / AnnotatedWords
- / PlainWords
-StyledWords <- '**' Words '**'
- / '*' Words '*'
- / '_' Words '_'
-LinkedWords <- '[' Words ']' '(' ((Uri _)? LinkTitle / Uri) ')'
- / '[' Words ']' LinkLabel
- / LinkLabel
-AnnotatedWords <- '[' Words ']' '{' ![{}] PlainWords '}'
-LinkLabel <- '[' _? ![\[\]] PlainWords _? ']'
-LinkTitle <- '"' _? !'"' _? PlainWords _? '"'
- / "'" _? !"'" PlainWords _? "'"
- / "(" _? ![()] PlainWords _? ")"
-PlainWords <- PRINTABLES (_ PRINTABLES)*
-Uri <- '<' ![<>] PRINTABLES? '>'
- / ![<>] PRINTABLES
-HardBreak <- SPACE SPACE+ NEWLINE
-_ <- SPACE+
- / SPACE? NEWLINE SPACE? SPACE? SPACE?
-
-# Terminals
-PRINTABLES <- [[:graph:]]+
-SPACE <- ' '
-NEWLINE <- '\r\n'
- / '\n'
- / '\r'
-
-# Semantic Markdown
-AnnotatedWordsX <- '[' Words ']'
- ('{' (SemWords / ![{}] PlainWords) '}')
-SemWords <- SEMPREFIX '<' ![<>] PRINTABLES '>'
- / SEMPREFIX Curie
-Curie <- NAME? ':' NAME?
-SEMPREFIX <- [.#]