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

@@ -59,8 +59,8 @@ func TestInterpolate0(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "stringptr",
Value: &ExprStr{
V: "foo",
@@ -103,8 +103,8 @@ func TestInterpolate0(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "stringptr",
Value: fieldName,
},
@@ -190,8 +190,8 @@ func TestInterpolateBasicStmt(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "stringptr",
Value: &ExprStr{
V: "foo",
@@ -208,8 +208,8 @@ func TestInterpolateBasicStmt(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "stringptr",
Value: &ExprStr{
V: "foo",
@@ -234,8 +234,8 @@ func TestInterpolateBasicStmt(t *testing.T) {
Name: &ExprStr{
V: "t${blah}",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "stringptr",
Value: &ExprStr{
V: "foo",
@@ -264,8 +264,8 @@ func TestInterpolateBasicStmt(t *testing.T) {
&StmtRes{
Kind: "test",
Name: resName,
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "stringptr",
Value: &ExprStr{
V: "foo",
@@ -290,8 +290,8 @@ func TestInterpolateBasicStmt(t *testing.T) {
Name: &ExprStr{
V: "t${42}", // incorrect type
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "stringptr",
Value: &ExprStr{
V: "foo",
@@ -321,8 +321,8 @@ func TestInterpolateBasicStmt(t *testing.T) {
&StmtRes{
Kind: "test",
Name: resName,
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "stringptr",
Value: &ExprStr{
V: "foo",