Skip to content

Instantly share code, notes, and snippets.

@egoist
Last active December 14, 2016 10:31
Show Gist options
  • Save egoist/6c6269dad4e40e31af28a0e8bbe93d9a to your computer and use it in GitHub Desktop.
Save egoist/6c6269dad4e40e31af28a0e8bbe93d9a to your computer and use it in GitHub Desktop.
The minimal YAML alternative markup language
title: Hello
space: "with space"
array:
 - foo
 - bar
obj:
  foo:
    bar: 123

To AST:

{
  type: 'root',
  children: [
    {
      type: 'define', keyword: 'title', value: {
        type: 'string',
        value: 'Hello'
      }
    },
    {
      type: 'define', keyword: 'space', value: {
        type: 'string',
        value: 'with space'
      }
    },
    {
      type: 'define', keyword: 'array', value: {
        type: 'list',
        value: [
          'foo', 'bar'
        ]
      }
    },
    {
      type: 'define', keyword: 'obj', value: {
        type: 'nested',
        value: {
          
        }
      }
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment