sdlang-d 0.8.3

An SDL (Simple Declarative Language) library for D.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

SDLang-D

An SDL (Simple Declarative Language) library for D.

SDL is a data language like JSON, XML or YAML, except it's:

  • Less verbose than JSON and XML.
  • Type-aware.
  • Easier to learn and read than YAML.

This is what SDL looks like (some of these examples, and more, are from the SDL site):

first "Joe"
last "Coder"

numbers 12 53 2 635
names "Sally" "Frank N. Stein"
pets chihuahua="small" dalmation="hyper" mastiff="big"

mixed 34.7f "Tim" somedate=2010/08/14
folder "myFiles" color="yellow" protection=on {
    folder "my images" {
        file "myHouse.jpg" color=true date=2005/11/05
        file "myCar.jpg" color=false date=2002/01/05
    }
    folder "my documents" {
        document "resume.pdf"
    }
}

Tags are of this form:

[tag name] [values] [attributes] [children]

Tag and attribute names can optionally include a namespace prefix (ie, `namespace:name`). All parts are optional, the only exception being that an anonymous (ie, no name) tag must have at least one value.

Also:

  • Tags are separated by either newline or semicolon.
  • Whitespace and indentation is not significant (other than newlines).
  • The line-continuation operator is `\` (backslash). This can be used to split a tag across multiple lines.
  • Line comments start with either `#, // or --`.
  • Block comments start with `/* and end with */`.
  • All the data types and syntax details are described here.

Differences from original Java implementation

  • API is completely redesigned for D.
  • License is zlib/libpng, not LGPL. (No source from the Java or Ruby implementations was used or looked at.)
  • Anonymous tags are named `"" (empty string) not "content"`.
  • Dates with unknown or invalid time zones use a special type indicating "unknown time zone" (`DateTimeFracUnknownZone`) instead of assuming GMT.

Documentation

Authors:
  • Nick Sabalausky
Dependencies:
none
Versions:
0.10.6 2020-Apr-12
0.10.5 2019-Feb-23
0.10.4 2018-Jul-16
0.10.3 2018-May-30
0.10.2 2018-Feb-13
Show all 20 versions
Download Stats:
  • 0 downloads today

  • 3 downloads this week

  • 26 downloads this month

  • 28786 downloads total

Score:
2.7
Short URL:
sdlang-d.dub.pm