From 769bc273e14d34dcbc8af981be94343a6b5eaa71 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Sat, 20 Jun 2015 12:36:28 -0400 Subject: [PATCH] reorganize --- forge.go | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/forge.go b/forge.go index 6e20128..e4d0119 100644 --- a/forge.go +++ b/forge.go @@ -61,7 +61,25 @@ // An identifier which main contain periods which starts with a period, the references // are resolved from the settings current section (e.g. .value, .sub_section.value) // +// Directives +// * Comment: +// A comment is a pound symbol ('#') followed by any text any which ends with a newline (e.g. '# I am a comment\n') +// A comment can either be on a line of it's own or at the end of any line. Nothing can come after the comment +// until after the newline. +// * Directive: +// A directive is a setting, a identifier and a value. They are in the format ' = ;' +// All directives must end in a semicolon. The value can be any of the types defined above. +// * Section: +// A section is a grouping of directives under a common name. They are in the format ' { }'. +// All sections must be wrapped in brackets ('{', '}') and must all have a name. They do not end in a semicolon. +// Sections may be left empty, they do not have to contain any directives. +// * Include: +// An include statement tells the config parser to include the contents of another config file where the include +// statement is defined. Includes are in the format 'include "";'. The can be any glob +// like pattern which is compatible with `path.filepath.Match` http://golang.org/pkg/path/filepath/#Match +// // Note about references. +// // References are resolved during parsing not access (they do not act as pointers... today). // Meaning that if I have the following config: // setting = "value"; @@ -78,22 +96,6 @@ // This is mostly due to the naive implementation of references today. How they work may change in // future versions or they may disappear entirely. // -// Directives -// * Comment: -// A comment is a pound symbol ('#') followed by any text any which ends with a newline (e.g. '# I am a comment\n') -// A comment can either be on a line of it's own or at the end of any line. Nothing can come after the comment -// until after the newline. -// * Directive: -// A directive is a setting, a identifier and a value. They are in the format ' = ;' -// All directives must end in a semicolon. The value can be any of the types defined above. -// * Section: -// A section is a grouping of directives under a common name. They are in the format ' { }'. -// All sections must be wrapped in brackets ('{', '}') and must all have a name. They do not end in a semicolon. -// Sections may be left empty, they do not have to contain any directives. -// * Include: -// An include statement tells the config parser to include the contents of another config file where the include -// statement is defined. Includes are in the format 'include "";'. The can be any glob -// like pattern which is compatible with `path.filepath.Match` http://golang.org/pkg/path/filepath/#Match package forge import (