matrix-dsl

A simple DSL for fast generation of Matrix Bots or Application Services
git clone git://archive.git.mtrnord.blog/Nordgedanken/matrix-dsl.git
Log | Files | Refs | LICENSE

commit 314f168b5000b7021b730959d86c0d5e9e02e0fc
parent 98ce39ccd9f9f2478870ba5f25ce98e390a2edc5
Author: MTRNord <mtrnord1@gmail.com>
Date:   Mon, 23 Apr 2018 19:01:44 +0200

Small grammar optimizing

Diffstat:
A.gitignore | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mcmd/lexer/ast.go | 18+++++++-----------
2 files changed, 73 insertions(+), 11 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -0,0 +1,66 @@ +# Created by .ignore support plugin (hsz.mobi) +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/dictionaries +.idea/**/shelf + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-debug/ +cmake-build-release/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests +### Go template +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out diff --git a/cmd/lexer/ast.go b/cmd/lexer/ast.go @@ -11,16 +11,16 @@ type Section struct { } type PropertyArrays struct { - Key string `@Ident ":"` - Arrays []*Array `[ { @@ } ]` - Value *Value `[ | @@ ]` - Special *Special `[ | @@ ]` + Key string `@Ident ":"` + Arrays []*Array `[ { @@ } ]` + Value *Value `[ | @@ ]` + Event *string `[ | "["@Ident"]" ]` } type Property struct { - Key string `@Ident ":"` - Value *Value `| @@` - Special *Special `| @@` + Key string `@Ident ":"` + Value *Value `[ @@ ]` + Event *string `[ | "["@Ident"]" ]` } type Array struct { @@ -32,7 +32,3 @@ type Value struct { String *string ` @String` Number *float64 `| @Float` } - -type Special struct { - Key *string `"["@Ident"]"` -}