Munyo is a indent-based simple data language. type-name argument|param-name argument|param-name... type-name argument|param-name argument|param-name... ↑ Child items must be indented. Indents must be Tab(ASCII code 9). Whitespaces can't be used for the indentation. type-name|param-name|param-name arg|... ↑ Arguments are optional. In original Munyo, arguments consume everything before ('|' / EOL) except the separater which is one whitespace after 'type-name'/'param-name' some_type some argument |some_param some param arg ↑ The argument of 'some_type' is ' some argument ' and 'some_param' is 'some param arg' type-name argument| param-name argument|... ↑ 'param-name' can have preceding whitespaces. Whitespaces can't be used for 'type-name'/'param-name' because of the limitations of the syntax. You can use other characters(with special syntax like '\t','\n', etc.), but if you want to use Munyo with serde, you need to follow Rust's identifier naming syntax for 'type-name'/'param-name'. ↓ When you use Munyo with serde, a type can have multiple arguments. type-name argument1 argument2...|param-name argument|... type-name argument1 argument2 |param-name param-argument |... ↑ When it's used with serde without 'RestOf', whitespaces can be added between arguments, 'argument' and '|', 'param-name' and 'param-argument', and "param-argument' and '|'. When you use 'RestOf', the rest of the arguments are consumed including whitespaces, so you need to trim them if you don't need them. *Line continuation name argument\ continuation of the argument... ↑ Backslash with line-break means argument\ncontinuation. The argument is separated with the code LF(ASCII code 10) and tabs are ignored. name argument\ continuation... ↑ Tabs are ignored, which means it's no problem when indents are unaligned. name argument\ continuation of the argument... ↑ If the newline starts with whitespace, the continuation starts with whitespace. name argument| continuation ↑ '|' with line-break means argumentcontinuation. Nothing separates them. Tabs are ignored. type-name argument |param-name argument |param-name argument... ↑ Lines starts with '|' are continuation of the previous line. The param belongs to the last type in the prior lines. Tabs are ignored. name argument\ |param-name arg... ↑ When the previous line has a backslash with line-break, the argument ends with 'LF'. name argument| |param-name arg... ↑↓ This has the same meaning with name argument |param-name arg... *Comment ↓ When you use '||', the text from there to the line-break is commented out. munyo arg|| this is comment. ↓ If you want to end with '|', and write comments after that, you can use '|||' munyo arg||| comment continuation ↓ If you want to end with '\', and write comments after that, you can use '||\' munyo arg||\ comment continuation ↓ When you use serde without 'RestOf', you can add one whitespace between arg and '||' munyo arg || comment ↓ You can also add one whitespace between arg of param and '||' munyo arg | param arg || comment *Default type and empty line type >default-type-name ↑ Lines start with '>'(ASCII code 62) define default-types. ↓ When default-type is defined, typenames must be omitted. argument|param-name arg... ↓ If you want to specify the typename in this context, you need '>\'. >\type-name argument|param-name... With '>|': >|empty-line-type-name you can define empty-line-type. type-name argument... type-name argument... ↑↓ That's recognized as type-name argument... empty-line-type type-name argument... You can define both with >default-type-name|empty-line-type-name This affects only the current indentation level. >munyo|emp argument argument menyo monyo ↑↓ This is recognized as >munyo|emp munyo argument emp munyo argument menyo monyo ↑ Child and parent levels aren't affected. When you double the '>': >>default-type-name|empty-line-type-name the default and empty-line types are defined in the current and descendant levels. >>munyo|emp argument menyo monyo This is recognized as: >>munyo|emp munyo argument emp munyo menyo|| When an empty-line item is defined and there's an item after an empty line with an indent, it's considered as a child of the empty-line item. emp|| Empty-line items are aligned with the last line's indent level. How many tabs the line has are not relevant. monyo ↑ The child level is also affected, but the parent level is unaffected. When you triple the '>': >>>default-type-name|empty-line-type-name It's applied to to all lines below it at the same indentation level. foo >>>triple tripled bar still tripled child isnt affected ↑↓ This is recognized as foo >>>triple triple tripled bar triple still tripled child isnt affected ↓ When you use '>' multiple times in the current level, it's overridden. >munyo|manyo argument >penyo|ponyo argument ↑↓ That's recognized as: >munyo|manyo munyo argument manyo >penyo|ponyo penyo argument ponyo ↓ You can override them with empty items. >munyo|manyo munyo argument manyo >|ponyo|| Default item is canceled. argument|| <- default item doesn't occur. It's probably syntax error ponyo >munyo|manyo munyo argument manyo >penyo| || ↑ empty-line item is canceled. penyo argument || ↑ No empty-line item occured > || ↑ Both default and empty-line item is canceled '>>>' can be overridden in the same way as '>'. ↓ When there's no item but comments in a line, it's not considered an empty line. >|emp ||This line has comments, so no empty-line item appeared here. ↑↓ This is recognized as: >|emp emp ||This line has comments, so no empty-line item appeared here. When '>>' is used multiple times, it's overridden or stacked. ↓ If '>>' is used on the same level, it's overridden: >>penyo argument >>punyo argument ↑↓ This is recognized as: >>penyo penyo argument >>punyo punyo argument ↓ If '>>' is used on another level, it's stacked: >>ganbo argument >>punyo argument argument argument argument ↑↓ This is recognized as: >>ganbo ganbo argument >>punyo punyo argument punyo argument ganbo argument || ↑ 'punyo' affects decendants, but the parent is still 'ganbo' ganbo argument || ↑ This line is not a descendant of 'punyo', but 'ganbo' ↓ You can override the definition on the same level. >>ganbo argument >>punyo argument >> argument argument argument ↑↓ This is recognized as: >>ganbo ganbo argument >>punyo punyo argument >> argument || ← Probably syntax error ganbo argument ganbo argument || ↑ The parent definition is still alive. ↓ '>' definition is always prioritized over '>>' and '>>>' when conflicted. ↓ '>>>' definition is always prioritized over '>>' when conflicted. >tama >>pema argument >tama >>>pema argument2 >>>pema >>puma argument3 They are recognized as: >tama >>pema tama argument >tama >>>pema tama argument2 >>>pema >>puma pema argument3 In define statements, default-type-name and empty-line-type-name can have leading and trailing whitespaces. > default-type-name | empty-line-type-name || comments... *Special characters '\' and '|' are special characters. If you want to use them in a raw text, use '\\' and '\|'. They are considered normal characters '\' and '|'. '>','>>','>>>' are special characters when they are used on the start of the line. You can use '\>','\>>' and '\>>>' at the start of the line. '\r','\n','\t' are supported. They are ASCII code 13, 10, 9 respectively. The usages of '\' which aren't discribed in this specification is not valid. *Miscellaneous When default type is defined, you can't construct default item without arguments. || ↑ An empty line isn't considered as a default-type item with no arguments. |param-name arguments|... || ↑ Lines that start with '|' is not considered as a default-type item with no arguments with params. It's a line continuation. You can use these. >\default-type-name || ↑ No argument >\default-type-name|param-name arguments || ↑ No argument with a param