commit 748a36930af647864c28d52e027c0fdd94f8195e
parent d76c269e2fc5b1567b0c9932c45a8ddc22c5a7aa
Author: gearsix <gearsix@tuta.io>
Date: Thu, 19 Aug 2021 01:05:46 +0100
minor tidy to ast
Diffstat:
M | ast.txt | | | 25 | ++++++++++++------------- |
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/ast.txt b/ast.txt
@@ -2,26 +2,25 @@
ast
===
-pseudo-code to help remember the parsing rules
-for the ast, should try convert to to LARL when
-there's time.
+pseudo regex to help remember the syntax rules.
\u = unicode character (note utf-x currently just using std c ascii support)
\t = horizintal tab
\n = newline
+{x} = see rule x, 'x' must be the name of a rule or it's just regex syntax
node{
- "\n\n" = '<//>'
- "\u." = '<ol>', '<li>' = {list}
- "[*-] " = '<ul>', '<li>' = {list}
- "\t\u" = '<pre>'
- "\u\n==={=}\n" = '<h1>'
- "\u\n---{-}\n" = '<h2>'
- "\u[\u\n\t]\n\n" = '<p>'
+ "\n\n" = close open tag
+ "\u." = ol,li,{list}
+ "[*-] " = ul,li,{list}
+ "\t\u+" = pre/
+ "\u\n={3,}\n" = h1/
+ "\u\n-{3,}\n" = h2/
+ "\u(\u|\n|\t)+\n\n" = p/
}
list{
- "\n[\n\0]" = '</li>','</ol>'
- "\n\u." = '</li>','<li>'
- "\n\u[^.]" = (hardbreaks) ? '<br/>' : ' '
+ "\n\n" = '/li','/ol'
+ "\n\u." = '/li','li'
+ "\n\u[^.]" = (hardbreaks) ? 'br/' : ' '
}