-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: assign stmt in schema codegen and runtime value merge. (#787)
* fix: schema config key update at runtime Signed-off-by: peefy <[email protected]> * fix: schema unification optional annotation Signed-off-by: peefy <[email protected]> * chore: remove un-used code in lsp Signed-off-by: peefy <[email protected]> * test: add more test cases for schema inherit and modification in-place. Signed-off-by: peefy <[email protected]> * fix: normal attribute assign in the schema and add more test cases Signed-off-by: peefy <[email protected]> * fix: wrong grammar test cases for assign stmt in schema. Signed-off-by: peefy <[email protected]> --------- Signed-off-by: peefy <[email protected]>
- Loading branch information
Showing
24 changed files
with
271 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
schema Metadata: | ||
environment?: str = "qa" | ||
region?: str | ||
name?: str | ||
|
||
schema MySchema1: | ||
metadata?: Metadata = {} | ||
|
||
metadata.environment = "dev" | ||
metadata.region = "us-east-1" | ||
|
||
output = MySchema1 { | ||
metadata.name = "config" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
output: | ||
metadata: | ||
environment: dev | ||
region: us-east-1 | ||
name: config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
schema Metadata: | ||
environment?: str = "qa" | ||
region?: str | ||
name?: str | ||
|
||
schema MySchema1: | ||
metadata?: Metadata = {} | ||
|
||
metadata.environment = "dev" | ||
|
||
|
||
output = MySchema1 { | ||
metadata.name = "config" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
output: | ||
metadata: | ||
environment: dev | ||
name: config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
schema Metadata: | ||
environment?: str = "qa" | ||
region?: str | ||
name?: str | ||
|
||
schema MySchema1: | ||
metadata?: Metadata = { | ||
name = "config" | ||
} | ||
metadata.environment = "dev" | ||
metadata.region = "us-east-1" | ||
|
||
output = MySchema1 {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
output: | ||
metadata: | ||
environment: dev | ||
region: us-east-1 | ||
name: config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
schema Metadata: | ||
environment: str | ||
region: str | ||
name: str | ||
|
||
schema MySchema1: | ||
metadata: Metadata | ||
|
||
schema MySchema2(MySchema1): | ||
metadata.environment = "dev" | ||
|
||
schema MySchema3(MySchema2): | ||
metadata.region = "us-east-1" | ||
|
||
output = MySchema3 {metadata.name = "hello"} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
output: | ||
metadata: | ||
environment: dev | ||
region: us-east-1 | ||
name: hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
schema Metadata: | ||
environment: str | ||
region: str | ||
name: str | ||
|
||
schema MySchema1: | ||
metadata: Metadata | ||
|
||
schema MySchema2(MySchema1): | ||
metadata.environment = "dev" | ||
|
||
schema MySchema3(MySchema2): | ||
metadata.region = "us-east-1" | ||
|
||
output = MySchema3 { | ||
metadata.name = "hello" | ||
metadata.environment = "qa" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
output: | ||
metadata: | ||
environment: qa | ||
region: us-east-1 | ||
name: hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
schema MySchema: | ||
metadata: {str:} = {} | ||
|
||
metadata.environment = "dev" | ||
|
||
|
||
output = MySchema { | ||
metadata.name = "config" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
output: | ||
metadata: | ||
name: config | ||
environment: dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
schema MySchema: | ||
metadata: {str:} = {} | ||
|
||
metadata.environment = "dev" | ||
|
||
|
||
output = MySchema { | ||
metadata.environment = "qa" | ||
metadata.name = "config" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
output: | ||
metadata: | ||
environment: qa | ||
name: config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
alice: | ||
name: | ||
name: | ||
name: rename | ||
gender: female | ||
name: alice | ||
gender: female |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
schema Metadata: | ||
environment: str | ||
region: str | ||
name: str | ||
|
||
schema MySchema1: | ||
metadata: Metadata | ||
|
||
schema MySchema2(MySchema1): | ||
metadata: Metadata {environment = "dev"} | ||
|
||
schema MySchema3(MySchema2): | ||
metadata: Metadata {region = "us-east-1"} | ||
|
||
output = MySchema3 {metadata.name = "hello"} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
output: | ||
metadata: | ||
environment: dev | ||
region: us-east-1 | ||
name: hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
schema Metadata: | ||
environment: str | ||
region: str | ||
name: str | ||
|
||
schema MySchema1: | ||
metadata: Metadata | ||
|
||
schema MySchema2(MySchema1): | ||
metadata: Metadata {environment = "dev"} | ||
|
||
schema MySchema3(MySchema2): | ||
metadata: Metadata {region = "us-east-1"} | ||
|
||
output = MySchema3 { | ||
metadata.name = "hello" | ||
metadata.environment = "qa" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
output: | ||
metadata: | ||
environment: qa | ||
region: us-east-1 | ||
name: hello |