transpiler-maker
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
example.md
todeform.js

README.md

TodeForm (WIP)

Write TodeForm to show how to translate one language into another.
This is what is looks like:

<Name> := [Text] :: "name" => "Luke"


You can also write it directly as a Javascript object:

{
    Name: {
        type: ["Text"],
        pattern: [{text: "name"}],
        output: "Luke",
    },
}

Rules

TodeForm is a bunch of rules.
All parts of a rule are optional.
The pattern shows TodeFormer how to identify the rule.
"name"

A rule can also have an output.
The output shows how to translate into the target language.
"name" => "Luke"

A rule can also have a rule name.
The rule name must be unique and can help to identify the rule.
<NameVariable> :: "name" => "Luke"

A rule can also have a type.
[Text] :: "name" => "Luke"

A rule can have a type and name.
<NameVariable> [Text] :: "name" => "Luke"

Pattern

The pattern is a list of items.
It shows how to identify a rule.
It can consist of these items:

Text
"name" => "Luke"

Regex
/name/ => "Luke"

Rule Name
<NameVariable> => "Luke"

Type
[Text] => "{1}"

Value
'"luke"' => "Luke"

Output

The output shows TodeFormer how to translate into the target language.
"name" => "Luke"

The output can include an item from the rule's pattern.
"greet(" [Text] ")" => Hello {2}

The output can be in a different mode.
Translate: Your output can be translated again in your custom language.
"name" -> "Luke"