zephraph / jexl

The JSON Expression Language

Repository from Github https://github.comzephraph/jexlRepository from Github https://github.comzephraph/jexl

Jexl -- JSON Expression Language

A programming language whose syntax is pure JSON.

Examples

{
  "name": "fibonacci",
  "lang_version": "v0.1",
  "program": [
    {
      "function": {
        "name": "fib",
        "params": [{"n": "integer"}],
        "body": {
            "if": {
              "condition": { "less": [{ "var": "n" }, 2] },
              "then": [{ "var": "n" }],
              "else": [
                {
                  "add": [
                    {"fib": [{ "subtract": [{ "var": "n" }, 1 ]}]},
                    {"fib": [{"subtract": [{ "var": "n" }, 2 ]}]}
                  ]
                }
              ]
            }
          }
      }
    },
    {"print": [{"fib": [7]}]}
  ]
}
{
  "lang_version": "v0.1",
  "program": [
    { 
      "function": {
        "name": "greet",
        "params": [{ "name": "string" }],
        "body": { "print": [{ "concat": ["Hello, ", { "ref": "name" }] }]}
      }
    },
    {"greet": ["Alice"]}
  ]
}

About

The JSON Expression Language

License:Apache License 2.0


Languages

Language:TypeScript 100.0%