-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Properties #1396
base: master
Are you sure you want to change the base?
feat: Properties #1396
Changes from 33 commits
e972903
3680e52
84bad5e
aa8eb6b
5f12e96
3ab053d
8c34910
62184e4
d31c721
27dcee1
eca00f0
2844a2c
1feafe2
4c1aadc
ddcfaed
77c1a37
dae9b16
6fadfb2
80c8c3d
1889930
19977cb
50a25f7
3386fe4
6b4deca
42d6c86
792f557
d420b50
f9c4a4d
c9e8fa7
d3ab667
904fac9
5387fde
dceeec6
5be9a8c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,7 +191,7 @@ lazy_static! { | |
E087, Error, include_str!("./error_codes/E087.md"), | ||
E088, Error, include_str!("./error_codes/E088.md"), | ||
E089, Error, include_str!("./error_codes/E089.md"), | ||
E090, Warning, include_str!("./error_codes/E090.md"), // Incompatible reference Assignment | ||
E090, Warning, include_str!("./error_codes/E090.md"), // Incompatible reference Assignment | ||
E091, Warning, include_str!("./error_codes/E091.md"), | ||
E092, Info, include_str!("./error_codes/E092.md"), | ||
E093, Warning, include_str!("./error_codes/E093.md"), | ||
|
@@ -215,6 +215,9 @@ lazy_static! { | |
E111, Error, include_str!("./error_codes/E111.md"), // Duplicate interface methods with different signatures | ||
E112, Error, include_str!("./error_codes/E112.md"), // Incomplete interface implementation | ||
E113, Warning, include_str!("./error_codes/E113.md"), // Interface default method implementation | ||
E114, Error, include_str!("./error_codes/E114.md"), // Property in unsupported POU type | ||
E115, Error, include_str!("./error_codes/E115.md"), // Property defined in non-supported variable block | ||
Comment on lines
+218
to
+219
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unsupported/non-supported - should we go with "unsupported" for both? |
||
E116, Error, include_str!("./error_codes/E116.md"), // Property with invalid number of GET and/or SET blocks | ||
); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Property defined in non-stateful POU type | ||
|
||
Properties may only be defined in stateful POUs such as a `PROGRAM`,`CLASS` or `FUNCTION_BLOCK`. | ||
|
||
Errouneus code example: | ||
``` | ||
FUNCTION foo | ||
// Invalid definition | ||
PROPERTY bar : DINT | ||
GET | ||
bar := 42; | ||
END_GET | ||
END_PROPERTY | ||
END_FUNCTION | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Property defined in non-supported variable block | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be |
||
|
||
Properties only allow for variable blocks of type `VAR`. | ||
|
||
Errouneus code example: | ||
``` | ||
FUNCTION foo | ||
PROPERTY bar : DINT | ||
GET | ||
VAR /* ... */ END_VAR | ||
VAR_INPUT /* ... */ END_VAR // Invalid | ||
END_GET | ||
END_PROPERTY | ||
END_FUNCTION | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Property with invalid number of GET and/or SET blocks | ||
|
||
Properties must be non empty and at most contain one block of type GET or SET. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we emphasis (bold and/or italic) |
||
|
||
Errouneus code example: | ||
``` | ||
FUNCTION foo | ||
PROPERTY bar : DINT | ||
// Invalid, empty (no GET or SET block) | ||
END_PROPERTY | ||
PROPERTY baz : DINT | ||
// Invalid, two GET blocks | ||
GET END_GET | ||
GET END_GET | ||
END_PROPERTY | ||
PROPERTY qux : DINT | ||
// Invalid, two SET blocks | ||
SET END_SET | ||
SET END_SET | ||
END_PROPERTY | ||
END_FUNCTION | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to track the
PouType
here or can we get it via name from the index?