www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - SDLang-D v0.8.2 - SDL lib for D (like JSON/XML, but nicer)

reply Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
SDLang-D is D library to read/write SDL (Simple Declarative Language).
SDL is a data language like JSON or XML, except it's less verbose and
type-aware. Here's an example of SDL:

    // Websites
    SDLang-D "https://github.com/Abscissa/SDLang-D"
    Original_SDL "http://sdl.ikayzo.org/display/SDL/Language+Guide"

Changes in this version:

- Can now output SDL. (Via 'toSDLString()' funcs.)
- Properly handle non-Unix newlines.
- Allow '\r' escape sequences.
- Make DUB package <https://github.com/rejectedsoftware/dub>
- Fixed Windows buildscript.
- Fixed build-docs script so API reference properly excludes private
  modules.
- Rename 'build-unittests' -> 'build-unittest' (for consistency with 
  'bin/sdlang-unittest').
Mar 05 2013
next sibling parent Dan Olson <zans.is.for.cans yahoo.com> writes:
Now this is very good.  I so badly have wanted the simple data rep that
lisp has builtin and this is almost it.  XML, in my opinion, is ugly and
overly verbose.  JASON was better.  SDL looks to be just about right.
-- 
dano
Mar 06 2013
prev sibling parent reply "Kagamin" <spam here.lot> writes:
On Wednesday, 6 March 2013 at 03:57:09 UTC, Nick Sabalausky wrote:
 SDLang-D is D library to read/write SDL (Simple Declarative 
 Language).
 SDL is a data language like JSON or XML, except it's less 
 verbose and
 type-aware. Here's an example of SDL:

     // Websites
     SDLang-D "https://github.com/Abscissa/SDLang-D"
     Original_SDL 
 "http://sdl.ikayzo.org/display/SDL/Language+Guide"
As I understand, SDL doesn't support allman style of curly braces?
Mar 12 2013
parent Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
On Wed, 13 Mar 2013 06:35:45 +0100
"Kagamin" <spam here.lot> wrote:
 
 As I understand, SDL doesn't support allman style of curly braces?
Correct. This is because tags in SDL are newline-terminated. (It would be possible to allow it as a special-case, but I want to stay compatible SDL's official spec and reference implementation, which doesn't do that.) You can, however, simulate it with the line-continuation operator: mytag \ { subtag subtag } But unlike JavaScript (or early versions of Go, IIRC), if you do use allman-style by mistake, you're guaranteed to get an error instead of incorrect behavior: mytag { subtag subtag } SDLangException: file.sdl(2:1): Error: Anonymous tags must have at least one value. Come to think of it, I could probably customize the error message for that particular situation to say something more appropriate like "Opening curly braces cannot be on a separate new line".
Mar 13 2013