sxd

0.0.0 • Public • Published

sxd

SXD - Simple eXchange Dataformat?

Syntax

The general syntax for the SXD format is the following:

# This is a comment. Comments start with a '#' and the parser removes everything on the line after the '#'
# Comments must start with a space.

# Statements are the fundamental "building blocks".
STATEMENT

# Statements can have single arguments
STATEMENT(arg)

# Statements can have multiple arguments
STATEMENT(arg1, arg2, arg3, ...)

# Arguments can be passed "unknown" - using the ? character
STATEMENT(?, ...)

# Arguments can contain spaces
STATEMENT(this argument has spaces, this argument also has spaces)

# We can wrap arguments with quotes if they need to contain commas
STATEMENT("This argument can contain commas, which is nice", ...)

# If a quoted argument need to contain quotes, we can escape the characters
STATEMENT("This is so called \"trickery\"", ...)

# Statements can have free text
STATEMENT <Free Text>
STATEMENT(...) <Free Text>

# Statements can have a modifier, which are like special statements. The default modifier has no name
@[...]
STATEMENT(...) <Free Text>

# But we can also have named modifiers
@MODIFIER[...]
STATEMENT(...) <Free Text>

# Statements can have blocks
STATEMENT {
  <Block>
}
STATEMENT(...) {
  <Block>
}
STATEMENT(...) <Free Text> {
  <Block>
}

# Nested blocks are also allowed
STATEMENT(...) <Free Text> {
  STATEMENT(...) <Free Text> {
    <Block>
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i sxd

Weekly Downloads

1

Version

0.0.0

License

MIT

Unpacked Size

2.76 kB

Total Files

3

Last publish

Collaborators

  • eweilow