IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to s dot adaszewski at gmail dot com. User accounts
are meant only to report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
ADARED
projects. Thank you for your understanding!
Something to think about:
JailConf = conf:(JailBlock / Parameter / Comment)* { return { 'JailConf': conf } } Comment = comment:(_ "#" CommentText / _ "//" CommentText) { return { 'Comment': comment.join('') } } CommentText = [^\n]+ { return text() } Parameter = _ name:Name _ op:AssignmentOp _ value:Value _ ";" { return { 'Parameter': { 'name': name, 'op': op, 'value': value } } } / _ name:Name _ ";" { return { 'Parameter': { 'name': name, 'value': true } } } _ = [ \t\r\n]* { return '' } Name = [a-zA-Z.][a-zA-Z.0-9]* { return text() } AssignmentOp = "=" / "+=" Value = ListOfStrings / String String = UnquotedString / SingleQuotedString / DoubleQuotedString ListOfStrings = head:String tail:(_ "," _ String)+ { return [head].concat(tail.map(function(a) { return a[3] })) } UnquotedString = [^;"',]+ { return text() } NotSingleQuote = !("'" / "\\") . { return text() } EscapedSingleQuote = "\\" "'" { return '\\\'' } / "\\\\" { return '\\\\' } SingleQuotedString = "'" content:(NotSingleQuote / EscapedSingleQuote)* "'" { return content.join('') } NotDoubleQuote = !("\"" / "\\") . { return text() } EscapedDoubleQuote = "\\" "\"" { return '\\"' } / "\\\\" { return '\\\\' } DoubleQuotedString = "\"" content:(NotDoubleQuote / EscapedDoubleQuote)* "\"" { return content.join('') } JailBlock = _ name:JailName _ "{" _ body:JailBody _ "}" _ { return { 'JailBlock': { 'name': name, 'body': body } } } JailName = [a-zA-Z0-9][a-zA-Z0-9]* { return text() } JailBody = (Parameter / Comment)*