Snippets

Milfeulle Wakabamark BNF

Updated by Milfeulle

File wakabamark.bnf Modified

  • Ignore whitespace
  • Hide word diff
 
                  Formal definition
 
+initial := 2 ;
+
 NL  ::= (‘\r’)? ‘\n’ ;
 BOS ::= begin of string ;
 EOS ::= end of string ;
 
 message ::= BOS (message_blocks)+ EOS ;
 
-message_blocks ::= (cite_block | list_block | code_block | text_block) ;
+message_blocks ::= (cite_block
+                 |  list_block
+                 |  code_block
+                 |  text_block initial) ;
 
 list_block        ::= (bullet_list | tiret_list | ordered_list) ;
 bullet_list       ::= (bullet_list_item (BOL list_item_content)*)+ ;
 tiret_list_item   ::= BOL ‘-’ list_item_content ;
 ordered_list      ::= (ordered_list_item (BOL list_item_content)*)+ ;
 ordered_list_item ::= BOL digit ‘.’ list_item_content ;
-list_item_content ::= (‘□’)+ text EOL ;
+list_item_content ::= (‘□’)+ (text initial)+ EOL ;
 
-code_block ::= BOL “```” EOL (symbol)* BOL “```” EOL ;
+code_block ::= BOL (‘`’{initial,}) EOL (symbol)* BOL $1 EOL ;
 
 cite_block   ::= BOL cite_body EOL ;
 cite_body    ::= ‘>’ cite_content ;
-cite_content ::= (‘□’)+ (cite_body | text) ;
+cite_content ::= (‘□’)+ (cite_body | (text initial)+) ;
 
-text_block ::= text ((empty_line)+ | EOL message_blocks[text_block]) ;
+text_block ::= (text initial)+ EOL (empty_line)+ ;
 empty_line ::= (BOL (space)* EOL)+ ;
 
-text        ::= format ;
-format      ::= spoiler ;
-spoiler     ::= (“%%” text “%%” | cursive) ;
-cursive     ::= (‘__’ text ‘__’ | semibold) ;
-semibold    ::= (“**” text “**” | atom) ;
-atom        ::= (inline_code | link | symbol) ;
-inline_code ::= “``” (symbol)* “``” ;
+text (actual)    ::= (format (actual) | atom)+ ;
+format (actual)  ::= (spoiler (actual) | cursive | semibold) ;
+spoiler (actual) ::= (‘%’{actual})   text actual+1 $1 ;
+cursive          ::= (‘_’{initial,}) text actual   $1 ;
+semibold         ::= (‘*’{initial,}) text actual   $1 ;
+atom             ::= (inline_code | link | symbol) ;
+inline_code      ::= (‘`’{initial,}) (symbol)* $1 ;
 
 link          ::= (internal_link | external_link) ;
 internal_link ::= “>>” (‘/’ forum_link_id ‘/’)? topic_link_id ;
Updated by Milfeulle

File wakabamark.bnf Modified

  • Ignore whitespace
  • Hide word diff
 space  ::= Character.isSpace () ;
 symbol ::= Character ;
 
-message ::= BOS (
-            cite_block
-          | list_block
-          | code_block
-          | text_block
-          )+ EOS ;
+message ::= BOS (message_blocks)+ EOS ;
+
+message_blocks ::= (cite_block | list_block | code_block | text_block) ;
 
 list_block        ::= (bullet_list | tiret_list | ordered_list) ;
 bullet_list       ::= (bullet_list_item (BOL list_item_content)*)+ ;
 cite_body    ::= ‘>’ cite_content ;
 cite_content ::= (‘□’)+ (cite_body | text) ;
 
-text_block ::= (text ((empty_line)+ | EOS)) ;
+text_block ::= text ((empty_line)+ | EOL message_blocks[text_block]) ;
 empty_line ::= (BOL (space)* EOL)+ ;
 
 text        ::= format ;
 format      ::= spoiler ;
-spoiler     ::= (“%%” cursive “%%” | cursive) ;
-cursive     ::= (‘__’ semibold ‘__’ | semibold) ;
-semibold    ::= (“**” atom “**” | atom) ;
-atom        ::= (inline_code | link | symbol | format) ;
+spoiler     ::= (“%%” text “%%” | cursive) ;
+cursive     ::= (‘__’ text ‘__’ | semibold) ;
+semibold    ::= (“**” text “**” | atom) ;
+atom        ::= (inline_code | link | symbol) ;
 inline_code ::= “``” (symbol)* “``” ;
 
 link          ::= (internal_link | external_link) ;
Updated by Milfeulle

File wakabamark.bnf Modified

  • Ignore whitespace
  • Hide word diff
 BOL ::= (BOS | NL) ;
 EOL ::= (NL | EOS) ;
 
-digit ::= Character.isDigit () ;
-space ::= Character.isSpace () ;
+digit  ::= Character.isDigit () ;
+space  ::= Character.isSpace () ;
+symbol ::= Character ;
 
-message ::= (cite_block | list_block | code_block | text_block)+ ;
+message ::= BOS (
+            cite_block
+          | list_block
+          | code_block
+          | text_block
+          )+ EOS ;
 
 list_block        ::= (bullet_list | tiret_list | ordered_list) ;
 bullet_list       ::= (bullet_list_item (BOL list_item_content)*)+ ;
 ordered_list_item ::= BOL digit ‘.’ list_item_content ;
 list_item_content ::= (‘□’)+ text EOL ;
 
-code_block      ::= code_block_mark (code_block_line)* code_block_mark ;
-code_block_mark ::= BOL “```” EOL ;
-code_block_line ::= BOL (symbol)* EOL ;
+code_block ::= BOL “```” EOL (symbol)* BOL “```” EOL ;
 
 cite_block   ::= BOL cite_body EOL ;
 cite_body    ::= ‘>’ cite_content ;
 cite_content ::= (‘□’)+ (cite_body | text) ;
 
-text_block ::= ((paragraph)+ | (line)+) ;
-paragraph  ::= (empty_line)+ (line)+ ((empty_line)+ | EOS) ;
-line       ::= BOL (content)+ EOL ;
+text_block ::= (text ((empty_line)+ | EOS)) ;
 empty_line ::= (BOL (space)* EOL)+ ;
-content    ::= text ;
 
-text        ::= (format)+ ;
+text        ::= format ;
 format      ::= spoiler ;
 spoiler     ::= (“%%” cursive “%%” | cursive) ;
 cursive     ::= (‘__’ semibold ‘__’ | semibold) ;
 semibold    ::= (“**” atom “**” | atom) ;
 atom        ::= (inline_code | link | symbol | format) ;
-inline_code ::= “``” symbol “``” ;
+inline_code ::= “``” (symbol)* “``” ;
 
 link          ::= (internal_link | external_link) ;
 internal_link ::= “>>” (‘/’ forum_link_id ‘/’)? topic_link_id ;
 forum_link_id ::= alpha ;
 topic_link_id ::= digit ;
 external_link ::= (“http” | “https” | “ftp”) “://” ... ;
-
-symbol ::= !(NL) ;
Updated by Milfeulle

File wakabamark.bnf Modified

  • Ignore whitespace
  • Hide word diff
 digit ::= Character.isDigit () ;
 space ::= Character.isSpace () ;
 
-message ::= (list | line)+ ;
+message ::= (cite_block | list_block | code_block | text_block)+ ;
 
-list              ::= BOL (bullet_list | tiret_list | ordered_list) ;
-bullet_list       ::= (bullet_list_item (list_item_content)+)+ ;
-bullet_list_item  ::= ‘*’ ;
-tiret_list        ::= (tiret_list_item (list_item_content)+)+ ;
-tiret_list_item   ::= ‘-’ ;
-ordered_list      ::= (ordered_list_item (list_item_content)+)+ ;
-ordered_list_item ::= digit ‘.’ ;
+list_block        ::= (bullet_list | tiret_list | ordered_list) ;
+bullet_list       ::= (bullet_list_item (BOL list_item_content)*)+ ;
+bullet_list_item  ::= BOL ‘*’ list_item_content ;
+tiret_list        ::= (tiret_list_item (BOL list_item_content)*)+ ;
+tiret_list_item   ::= BOL ‘-’ list_item_content ;
+ordered_list      ::= (ordered_list_item (BOL list_item_content)*)+ ;
+ordered_list_item ::= BOL digit ‘.’ list_item_content ;
 list_item_content ::= (‘□’)+ text EOL ;
 
+code_block      ::= code_block_mark (code_block_line)* code_block_mark ;
+code_block_mark ::= BOL “```” EOL ;
+code_block_line ::= BOL (symbol)* EOL ;
+
+cite_block   ::= BOL cite_body EOL ;
+cite_body    ::= ‘>’ cite_content ;
+cite_content ::= (‘□’)+ (cite_body | text) ;
+
+text_block ::= ((paragraph)+ | (line)+) ;
+paragraph  ::= (empty_line)+ (line)+ ((empty_line)+ | EOS) ;
 line       ::= BOL (content)+ EOL ;
 empty_line ::= (BOL (space)* EOL)+ ;
-content    ::= (cite | code_line | text) ;
-
-cite         ::= ‘>’ cite_content ;
-cite_content ::= (‘□’)+ (cite | text) ;
-
-code_line ::= (‘\t’ | “□□□□”) (symbol)+ ;
+content    ::= text ;
 
-text     ::= (format)+ ;
-format   ::= spoiler ;
-spoiler  ::= (“%%” cursive “%%” | cursive) ;
-cursive  ::= (‘*’ semibold ‘*’ | ‘_’ semibold ‘_’ | semibold) ;
-semibold ::= (“**” atom “**” | “__” atom “__” | atom) ;
-atom     ::= (code | link | symbol | format) ;
-code     ::= ‘`’ symbol ‘`’ ;
+text        ::= (format)+ ;
+format      ::= spoiler ;
+spoiler     ::= (“%%” cursive “%%” | cursive) ;
+cursive     ::= (‘__’ semibold ‘__’ | semibold) ;
+semibold    ::= (“**” atom “**” | atom) ;
+atom        ::= (inline_code | link | symbol | format) ;
+inline_code ::= “``” symbol “``” ;
 
 link          ::= (internal_link | external_link) ;
 internal_link ::= “>>” (‘/’ forum_link_id ‘/’)? topic_link_id ;
 topic_link_id ::= digit ;
 external_link ::= (“http” | “https” | “ftp”) “://” ... ;
 
-symbol ::= !(EOL) ;
+symbol ::= !(NL) ;
Updated by Milfeulle

File wakabamark.bnf Modified

  • Ignore whitespace
  • Hide word diff
 
 code_line ::= (‘\t’ | “□□□□”) (symbol)+ ;
 
-text      ::= (format)+ ;
-format    ::= spoiler ;
-spoiler   ::= “%%” cursive “%%” ;
-cursive   ::= (‘*’ semibold ‘*’ | ‘_’ semibold ‘_’) ;
-semibold  ::= (“**” atom “**” | “__” atom “__”) ;
-atom      ::= (code | link | symbol) ;
-code      ::= ‘`’ symbol ‘`’ ;
+text     ::= (format)+ ;
+format   ::= spoiler ;
+spoiler  ::= (“%%” cursive “%%” | cursive) ;
+cursive  ::= (‘*’ semibold ‘*’ | ‘_’ semibold ‘_’ | semibold) ;
+semibold ::= (“**” atom “**” | “__” atom “__” | atom) ;
+atom     ::= (code | link | symbol | format) ;
+code     ::= ‘`’ symbol ‘`’ ;
 
 link          ::= (internal_link | external_link) ;
 internal_link ::= “>>” (‘/’ forum_link_id ‘/’)? topic_link_id ;
  1. Prev
  2. 1
  3. 2
  4. Next