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

@@ -320,8 +320,8 @@ func TestLexParse0(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "int64ptr",
Value: &ExprCall{
Name: operatorFuncName,
@@ -361,8 +361,8 @@ func TestLexParse0(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "float32",
Value: &ExprCall{
Name: operatorFuncName,
@@ -413,8 +413,8 @@ func TestLexParse0(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "int64ptr",
Value: &ExprCall{
Name: operatorFuncName,
@@ -465,8 +465,8 @@ func TestLexParse0(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "int64ptr",
Value: &ExprCall{
Name: operatorFuncName,
@@ -517,8 +517,8 @@ func TestLexParse0(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "int64ptr",
Value: &ExprCall{
Name: operatorFuncName,
@@ -569,8 +569,8 @@ func TestLexParse0(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "boolptr",
Value: &ExprCall{
Name: operatorFuncName,
@@ -621,8 +621,8 @@ func TestLexParse0(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "boolptr",
Value: &ExprCall{
Name: operatorFuncName,
@@ -673,8 +673,8 @@ func TestLexParse0(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "boolptr",
Value: &ExprCall{
Name: operatorFuncName,
@@ -722,8 +722,8 @@ func TestLexParse0(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "boolptr",
Value: &ExprCall{
Name: operatorFuncName,
@@ -774,8 +774,8 @@ func TestLexParse0(t *testing.T) {
Name: &ExprStr{
V: "t1",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "int64ptr",
Value: &ExprInt{
V: 42,
@@ -788,8 +788,8 @@ func TestLexParse0(t *testing.T) {
Name: &ExprStr{
V: "t2",
},
Fields: []*StmtResField{
{
Contents: []StmtResContents{
&StmtResField{
Field: "int64ptr",
Value: &ExprInt{
V: 13,