lang: Add internal, resource specific edges

This adds the ability to specify internal, resource specific edges, with
and without notifications. We use the special words: "Notify", "Before",
"Listen", and "Depend". They must have the first character capitalized.
They also support the "elvis" operator.
This commit is contained in:
James Shubin
2018-02-27 21:18:17 -05:00
parent 8e01b6db48
commit 3ad7097c8a
7 changed files with 649 additions and 175 deletions

View File

@@ -51,8 +51,8 @@ func TestUnification1(t *testing.T) {
&StmtRes{
Kind: "test",
Name: &ExprStr{V: "t1"},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "str",
Value: expr,
},
@@ -85,8 +85,8 @@ func TestUnification1(t *testing.T) {
&StmtRes{
Kind: "test",
Name: &ExprStr{V: "test"},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "slicestring",
Value: expr,
},
@@ -125,8 +125,8 @@ func TestUnification1(t *testing.T) {
&StmtRes{
Kind: "test",
Name: &ExprStr{V: "test"},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "mapintfloat",
Value: expr,
},
@@ -167,8 +167,8 @@ func TestUnification1(t *testing.T) {
&StmtRes{
Kind: "test",
Name: &ExprStr{V: "test"},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "mixedstruct",
Value: expr,
},
@@ -215,8 +215,8 @@ func TestUnification1(t *testing.T) {
Name: &ExprStr{
V: "n1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "int64ptr",
Value: expr, // func
},
@@ -270,8 +270,8 @@ func TestUnification1(t *testing.T) {
Name: &ExprStr{
V: "n1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "int64ptr",
Value: expr,
},
@@ -326,8 +326,8 @@ func TestUnification1(t *testing.T) {
Name: &ExprStr{
V: "n1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "float32",
Value: expr,
},
@@ -458,8 +458,8 @@ func TestUnification1(t *testing.T) {
&StmtRes{
Kind: "test",
Name: &ExprStr{V: "t1"},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "stringptr",
Value: expr,
},
@@ -493,8 +493,8 @@ func TestUnification1(t *testing.T) {
&StmtRes{
Kind: "test",
Name: &ExprStr{V: "t1"},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "stringptr",
Value: expr,
},