more.ason

An ASON parser.

Members

Classes

AsonParseException
class AsonParseException
Undocumented in source.

Enums

AsonErrorType
enum AsonErrorType
Undocumented in source.

Functions

arrayRange
string arrayRange(char min, char max, string initializer)
Undocumented in source. Be warned that the author may not have intended to support it.
parseAson
void parseAson(AsonOptions options, string sdl)
Undocumented in source. Be warned that the author may not have intended to support it.
parseAson
void parseAson(AsonOptions options, char[] sdlText)

Parses one SDL tag (not including its children) from sdlText saving slices for every name/value/attribute to the given tag struct. This function assumes that sdlText contains at least one full SDL _tag. The only time this function will allocate memory is if the value/attribute appenders in the tag struct are not large enough to hold all the values. Because of this, after the tag values/attributes are populated, it is up to the caller to copy any memory they wish to save unless sdlText is going to persist in memory. Note: this function does not handle the UTF-8 bom because it doesn't make sense to re-check for the BOM after every tag.

rangeInitializers
string rangeInitializers(string[] s)
Undocumented in source. Be warned that the author may not have intended to support it.
rangeInitializersCurrent
string rangeInitializersCurrent(string[] s)
Undocumented in source. Be warned that the author may not have intended to support it.
rangeInitializersNext
string rangeInitializersNext(string[] s)
Undocumented in source. Be warned that the author may not have intended to support it.
sdlLiteralToD
T sdlLiteralToD(const(char)[] literal)

Converts literal to the given D type T. This is a wrapper arround the sdlLiteralToD function that returns true on sucess, except this function returns the value itself and throws an AsonParseException on error.

sdlLiteralToD
bool sdlLiteralToD(const(char)[] literal, T t)

Converts literal to the given D type T. If isSomeString!T, then it will remove the surrounding quotes if they are present.

setupAsonText
char[] setupAsonText(const(char[]) asonText, bool copyAson)
Undocumented in source. Be warned that the author may not have intended to support it.

Manifest constants

invalidBraceFmt
enum invalidBraceFmt;
Undocumented in source.
mixedValuesAndAttributesFmt
enum mixedValuesAndAttributesFmt;
Undocumented in source.
noEndingQuote
enum noEndingQuote;
Undocumented in source.
notEnoughCloseBracesFmt
enum notEnoughCloseBracesFmt;
Undocumented in source.
tooManyCloseBraces
enum tooManyCloseBraces;
Undocumented in source.

Structs

Ason
struct Ason
Undocumented in source.
AsonBuffer2Sink
struct AsonBuffer2Sink
Undocumented in source.
AsonOptions
struct AsonOptions
Undocumented in source.
AsonParser
struct AsonParser

A convenience function to parse a single tag. Calls tag.resetForReuse and then calls parseAsonTag.

Attribute
struct Attribute
Undocumented in source.
Tag
struct Tag

Embodies all the information about a single tag. It does not contain any information about its children because that part of the sdl would not have been parsed yet. It is used directly for the StAX/SAX APIs but not for the DOM or Reflection APIs.

Variables

asonBuffer
char[2048] asonBuffer;
Undocumented in source.
asonBuffer2
char[asonBuffer.length] asonBuffer2;
Undocumented in source.
controlCharacter
enum ubyte controlCharacter;
Undocumented in source.
whitespace
enum ubyte whitespace;
Undocumented in source.

Examples

// Possible API:
serializeToAson(R,T)(R sink, T value);
deserializeAson(T,R)(R input);

Ason parseAson(R)(ref R range, int* line = null);
Ason parseAson(string text);

void writeAson(R, bool compressed)(ref R sink, in Json json, size_t level);

struct Ason : represents single Ason value
struct AsonSerializer : serializer for Ason
struct AsonStringSerializer : serializer for a range based plain ASON string

Meta

Authors

Jonathan Marler, johnnymarler@gmail.com

License

use freely for any purpose