munyo 0.3.5

A data language which aims to be the most efficient way to handwrite data.
Documentation
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).
Separaters are single whitespace and '|'(ASCII code 124). Two whitespaces are recognized as the argument starts with one whitespace.
Arguments are optional.

	type-name|param-name|param-name arg|...

'param-name' can have preceding whitespaces.

	type-name argument|   param-name argument|...

*Line continuation

	name argument\
	continuation of the argument...

Backslash with line-break means argument\ncontinuation. Two arguments are separated with the line-break code 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

*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 level.

	>munyo|manyo
	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 use '>' multiple times in the current level, it's overwritten.

	>munyo|manyo
	argument

	>penyo|ponyo
	argument

That's recognized as:

	>munyo|manyo
	munyo argument
	manyo
	>penyo|ponyo
	penyo argument
	ponyo

You can overwrite 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

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 overwritten or stacked.

If '>>' is used on the same level, it's overwritten:

>>penyo
argument
>>punyo
argument

This is recognized as:

>>penyo
penyo argument
>>punyo
punyo argument

If '>>' is used on the other 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 overwrite 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 '>>' when conflicted.

>tama
>>pema
argument

It's recognized as

>tama
>>pema
tama argument

*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.
'>>>' and '\>>>' on the start of a line are reserved.
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