aboutsummaryrefslogtreecommitdiff
path: root/syntax/def.peg
diff options
context:
space:
mode:
Diffstat (limited to 'syntax/def.peg')
-rw-r--r--syntax/def.peg12
1 files changed, 8 insertions, 4 deletions
diff --git a/syntax/def.peg b/syntax/def.peg
index 7696a0d..0c99c80 100644
--- a/syntax/def.peg
+++ b/syntax/def.peg
@@ -28,12 +28,18 @@ StyledWords <- '**' Words '**'
LinkedWords <- '[' Words ']' '(' ((Uri _)? LinkTitle / Uri) ')'
/ '[' Words ']' LinkLabel
/ LinkLabel
-AnnotatedWords <- '[' Words ']' '{' ![{}] PlainWords '}'
+AnnotatedWords <- '[' Words ']' '{' KeyWords '}'
LinkLabel <- '[' _? ![\[\]] PlainWords _? ']'
LinkTitle <- '"' _? !'"' _? PlainWords _? '"'
/ "'" _? !"'" PlainWords _? "'"
/ "(" _? ![()] PlainWords _? ")"
+KeyWords <- KeyWord (_ KeyWord)*
PlainWords <- PRINTABLES (_ PRINTABLES)*
+KeyWord <- Identifier / Class / Attribute / '-'
+Identifier <- '#' [[:alpha:]] [[:alnum:]]*
+Class <- '.' [[:alpha:]] [[:alnum:]]*
+Attribute <- [[:alpha:]] [[:alnum:]]* SPACE* = SPACE*
+ ('"' [[:alnum:]]+ '"' / [[:alnum:]]+)
Uri <- '<' ![<>] PRINTABLES? '>'
/ ![<>] PRINTABLES
HardBreak <- SPACE SPACE+ NEWLINE
@@ -55,9 +61,7 @@ BlockX <- LinkDefinition
/ List
/ Paragraph
PrefixDefinition <- '{' CuriePrefix '}' ':' _? SemWord NEWLINE
-AnnotatedWordsX <- '[' Words ']'
- ('{' (SemWords / ![{}] PlainWords) '}')
-SemWords <- SemWord (_ SemWord)*
+KeyWordX <- SemWord / Identifier / Class / Attribute / '-'
SemWord <- SEMPREFIX '<' ![<>] PRINTABLES '>'
/ SEMPREFIX Curie
SEMPREFIX <- [.=]