csharpfritz / TAML

Defining the coolest and simplest markup language delimited ONLY by tabs
MIT License
23 stars 11 forks source link

Discussion: Introduction of the Concept of Parser Directives #25

Closed Stelzi79 closed 3 years ago

Stelzi79 commented 4 years ago

If(when) we introduce something like Schema Definitions we need a way to tell a possible parser, etc to tell what and where they can find the schema.

I suggest we introduce the concept of Parser Directives.

In many usages like in programming languages look like some special comments. So I suggest the following syntax if(when) we provide a built in official specification of Schema Definitions:

    <CommentSequence><CommentSequence>TAML.Schema   <Place to find the Schema>

Alternatively if the <CommentSequence> turns out to be something not fitting in this case I suggest the following syntax:

    <CommentSequence>#TAML.Schema   <Place to find the Schema>

Notes:

The aspects of custom Parser Directives being able to interact with the parser I would say would be a "down the line" feature that won't be in a 1.0 release version.

Additionally there would have to be the discussion about that we only allow Parser Directives on top of the TAML file to make parsing the actual file not way more complicated or slow than it hast to be.

The goal of introducing the concept of Parser Directives early in this project would be that there is an official syntax for such things already and nobody that needs such a feature is inventing there own syntax and make things looking messy.

csharpfritz commented 3 years ago

Resolved with specification 1.1:

Directives are defined on a line that starts with a ! and have a name that is properly namespaced with an optional assigned value separated by one or more tabs

! TAML.EmptyArraySupported  FALSE