Skip to content

Instantly share code, notes, and snippets.

@5paceToast 5paceToast/news.peg
Last active Dec 19, 2019

Embed
What would you like to do?
Toast NEWS PEG
Document <- DocPart+
DocPart <- VersionHeader ( AuthPart EOL )+
VersionHeader <- SectSep Version '(' Date ')' EndOfLine EndOfLine
AuthPart <- AuthorLine Item+
AuthorLine <- Author EOL
Author <- ASCII+ ('"' DomChar+ '"')? ASCII+ '<' Email '>'
Email <- Char+ '@' Domain
Domain <- DomChar+ ( PERIOD DomChar+ )+
Item <- Bullet SPACE ( BaseChar TxtChar* EOL )+
Version <- 'v' Num '.' Num '.' Num PreVer VerMeta
PreVer <- '-' VerChar+ / ''
VerMeta <- '+' VerChar+ / ''
Date <- Year DASH Month DASH Day
Year <- Num
Month <- '1' ( '0' / '1' / '2' ) / Digit
Day <- '3' ( '0' / '1' ) / '2' Digit / '1' Digit / Digit
BaseChar <- ASCII / Digit
DomChar <- BaseChar / DASH
Num <- Digit+
TxtChar <- VerChar / Punct
VerChar <- DomChar / PERIOD
ASCII <- [a-zA-Z]
Bullet <- PERIOD / STAR / DASH
Digit <- [0-9]
Punct <- [,;]
SectSep <- TAB / STAB
DASH <- '-'
EOF <- !.
EOL <- '\r\n' / '\n' / '\r'
PERIOD <- '.'
SPACE <- ' '
STAB <- ' '
STAR <- '*'
TAB <- '\t'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.