-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds tracing for markup strings (#67)
adds tracing for chapter 19
- Loading branch information
1 parent
c7ccbc2
commit 9656026
Showing
39 changed files
with
182 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package Div_By_Zero | ||
|
||
type T { | ||
x Integer | ||
y Integer | ||
} | ||
|
||
checks T { | ||
x > 2, fatal "x too small" | ||
y > 2, fatal "y too small" | ||
|
||
100 / (111 - x * y) > 0, "example" | ||
} |
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 @@ | ||
--no-detailed-info |
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,40 +1,25 @@ | ||
type Q extends T { | ||
^ lint-ug-examples/clarify_final.rsl:7: issue: consider clarifying that this record is final [clarify_final] | ||
| Parent record Clarify_Final.T is final, making this record | ||
| also final. Marking it explicitly as final | ||
| clarifies this to casual readers. | ||
-x / 3 < 0, "non-obvious meaning" | ||
^ lint-ug-examples/unary_minus_precedence.rsl:8: issue: expression means -(x / 3), place explicit brackets to clarify intent [unary_minus_precedence] | ||
description != null, "description cannot be empty" | ||
^^ lint-ug-examples/always_true.rsl:12: issue: expression is always true [vcg-always-true] | ||
len(x) >= 3 implies x[3] > 0, "too small" | ||
^ lint-ug-examples/array_index.rsl:8: issue: array index could be larger than len(x) [vcg-array-index] | ||
| example record_type triggering error: | ||
| T bad_potato { | ||
| x = [1, 1, 1] | ||
| } | ||
100 / (111 - x * y) > 0, "example" | ||
^ lint-ug-examples/div_by_zero.rsl:12: issue: divisor could be 0 [vcg-div-by-zero] | ||
len(description) >= 10, "too short" | ||
^^^^^^^^^^^ lint-ug-examples/evaluation_of_null.rsl:8: issue: expression could be null [vcg-evaluation-of-null] | ||
| example record_type triggering error: | ||
| Requirement bad_potato { | ||
| /* description is null */ | ||
| } | ||
x Integer [10 .. 3] | ||
^ lint-ug-examples/impossible_array_types.rsl:4: issue: upper bound must be at least 10 [impossible_array_types] | ||
y Integer [0 .. 0] | ||
^ lint-ug-examples/impossible_array_types.rsl:5: issue: this array makes no sense [impossible_array_types] | ||
separator x | ||
^ lint-ug-examples/separator_based_literal_ambiguity.rsl:5: issue: x separator after integer component creates ambiguities [separator_based_literal_ambiguity] | ||
| For example 0x100 would be a base 16 literal | ||
| instead of the tuple segment 0 x 100. | ||
x Integer [1 .. 1] | ||
^ lint-ug-examples/weird_array_types.rsl:4: issue: array of fixed size 1 should not be an array [weird_array_types] | ||
| An array with a fixed size of 1 should not | ||
| be an array at all. | ||
y Integer [0 .. 1] | ||
^ lint-ug-examples/weird_array_types.rsl:5: issue: consider making this array an optional Integer [weird_array_types] | ||
| An array with 0 to 1 components should just | ||
| be an optional Integer instead. | ||
abstract type T { | ||
^ lint-ug-examples/abstract_leaf_types.rsl:3: issue: abstract type T does not have any extensions [abstract_leaf_types] | ||
Processed 13 models and 0 requirement files and found 11 warnings | ||
Processed 14 models and 0 requirement files and found 12 warnings |
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,2 +1,2 @@ | ||
{} | ||
Processed 13 models and 0 requirement files and found no issues | ||
Processed 14 models and 0 requirement files and found no issues |
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,40 +1,25 @@ | ||
type Q extends T { | ||
^ lint-ug-examples/clarify_final.rsl:7: issue: consider clarifying that this record is final [clarify_final] | ||
| Parent record Clarify_Final.T is final, making this record | ||
| also final. Marking it explicitly as final | ||
| clarifies this to casual readers. | ||
-x / 3 < 0, "non-obvious meaning" | ||
^ lint-ug-examples/unary_minus_precedence.rsl:8: issue: expression means -(x / 3), place explicit brackets to clarify intent [unary_minus_precedence] | ||
description != null, "description cannot be empty" | ||
^^ lint-ug-examples/always_true.rsl:12: issue: expression is always true [vcg-always-true] | ||
len(x) >= 3 implies x[3] > 0, "too small" | ||
^ lint-ug-examples/array_index.rsl:8: issue: array index could be larger than len(x) [vcg-array-index] | ||
| example record_type triggering error: | ||
| T bad_potato { | ||
| x = [1, 1, 1] | ||
| } | ||
100 / (111 - x * y) > 0, "example" | ||
^ lint-ug-examples/div_by_zero.rsl:12: issue: divisor could be 0 [vcg-div-by-zero] | ||
len(description) >= 10, "too short" | ||
^^^^^^^^^^^ lint-ug-examples/evaluation_of_null.rsl:8: issue: expression could be null [vcg-evaluation-of-null] | ||
| example record_type triggering error: | ||
| Requirement bad_potato { | ||
| /* description is null */ | ||
| } | ||
x Integer [10 .. 3] | ||
^ lint-ug-examples/impossible_array_types.rsl:4: issue: upper bound must be at least 10 [impossible_array_types] | ||
y Integer [0 .. 0] | ||
^ lint-ug-examples/impossible_array_types.rsl:5: issue: this array makes no sense [impossible_array_types] | ||
separator x | ||
^ lint-ug-examples/separator_based_literal_ambiguity.rsl:5: issue: x separator after integer component creates ambiguities [separator_based_literal_ambiguity] | ||
| For example 0x100 would be a base 16 literal | ||
| instead of the tuple segment 0 x 100. | ||
x Integer [1 .. 1] | ||
^ lint-ug-examples/weird_array_types.rsl:4: issue: array of fixed size 1 should not be an array [weird_array_types] | ||
| An array with a fixed size of 1 should not | ||
| be an array at all. | ||
y Integer [0 .. 1] | ||
^ lint-ug-examples/weird_array_types.rsl:5: issue: consider making this array an optional Integer [weird_array_types] | ||
| An array with 0 to 1 components should just | ||
| be an optional Integer instead. | ||
abstract type T { | ||
^ lint-ug-examples/abstract_leaf_types.rsl:3: issue: abstract type T does not have any extensions [abstract_leaf_types] | ||
Processed 13 models and 0 requirement files and found 11 warnings | ||
Processed 14 models and 0 requirement files and found 12 warnings |
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 @@ | ||
package Foo | ||
|
||
type T { | ||
a Markup_String | ||
} |
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 @@ | ||
package Foo | ||
|
||
T Bar { | ||
a = "[[Bar" | ||
} | ||
|
||
T But { | ||
a = "But]]" | ||
} | ||
|
||
T Baz { | ||
a = "[[Baz[[But]]]]" | ||
} |
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,7 @@ | ||
a = "[[Bar" | ||
^^^ rbt-markup-string-errors/foo.trlc:4: error: expected ]], encountered end-of-string instead | ||
a = "But]]" | ||
^^ rbt-markup-string-errors/foo.trlc:8: error: opening [[ for this ]] found | ||
a = "[[Baz[[But]]]]" | ||
^^ rbt-markup-string-errors/foo.trlc:12: error: cannot nest reference lists | ||
Processed 1 model and 1 requirement file and found 3 errors |
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,3 @@ | ||
rbt-markup-string-errors/foo.trlc:4:12: trlc error: expected ]], encountered end-of-string instead | ||
rbt-markup-string-errors/foo.trlc:8:13: trlc error: opening [[ for this ]] found | ||
rbt-markup-string-errors/foo.trlc:12:15: trlc error: cannot nest reference lists |
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,7 @@ | ||
a = "[[Bar" | ||
^^^ rbt-markup-string-errors/foo.trlc:4: error: expected ]], encountered end-of-string instead | ||
a = "But]]" | ||
^^ rbt-markup-string-errors/foo.trlc:8: error: opening [[ for this ]] found | ||
a = "[[Baz[[But]]]]" | ||
^^ rbt-markup-string-errors/foo.trlc:12: error: cannot nest reference lists | ||
Processed 1 model and 1 requirement file and found 3 errors |
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,7 @@ | ||
a = "[[Bar" | ||
^^^ rbt-markup-string-errors/foo.trlc:4: error: expected ]], encountered end-of-string instead | ||
a = "But]]" | ||
^^ rbt-markup-string-errors/foo.trlc:8: error: opening [[ for this ]] found | ||
a = "[[Baz[[But]]]]" | ||
^^ rbt-markup-string-errors/foo.trlc:12: error: cannot nest reference lists | ||
Processed 1 model and 1 requirement file and found 3 errors |
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 @@ | ||
package Foo | ||
|
||
type T { | ||
a Markup_String | ||
} |
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 @@ | ||
package Foo | ||
|
||
T Bar { | ||
a = "bar [[Inline]]" | ||
} | ||
|
||
T Inline { | ||
a = "inline" | ||
} |
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 @@ | ||
Processed 1 model and 1 requirement file and found no issues |
Empty file.
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 @@ | ||
{ | ||
"Bar": { | ||
"a": "bar [[Inline]]" | ||
}, | ||
"Inline": { | ||
"a": "inline" | ||
} | ||
} | ||
Processed 1 model and 1 requirement file and found no issues |
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 @@ | ||
Processed 1 model and 1 requirement file and found no issues |
5 changes: 5 additions & 0 deletions
5
tests-system/rbt-markup-string-late-reference-resolution/foo.rsl
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 @@ | ||
package Foo | ||
|
||
type T { | ||
a Markup_String | ||
} |
13 changes: 13 additions & 0 deletions
13
tests-system/rbt-markup-string-late-reference-resolution/foo.trlc
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 @@ | ||
package Foo | ||
|
||
T Bar { | ||
a = "[[Bar]]" | ||
} | ||
|
||
T But { | ||
a = "[[Baz]]" | ||
} | ||
|
||
T Baz { | ||
a = "[[Baz]]" | ||
} |
1 change: 1 addition & 0 deletions
1
tests-system/rbt-markup-string-late-reference-resolution/output
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 @@ | ||
Processed 1 model and 1 requirement file and found no issues |
Empty file.
12 changes: 12 additions & 0 deletions
12
tests-system/rbt-markup-string-late-reference-resolution/output.json
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,12 @@ | ||
{ | ||
"Bar": { | ||
"a": "[[Bar]]" | ||
}, | ||
"Baz": { | ||
"a": "[[Baz]]" | ||
}, | ||
"But": { | ||
"a": "[[Baz]]" | ||
} | ||
} | ||
Processed 1 model and 1 requirement file and found no issues |
1 change: 1 addition & 0 deletions
1
tests-system/rbt-markup-string-late-reference-resolution/output.smtlib
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 @@ | ||
Processed 1 model and 1 requirement file and found no issues |
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 @@ | ||
package Foo | ||
|
||
type T { | ||
a Markup_String | ||
} |
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 @@ | ||
package Foo | ||
|
||
T Bar { | ||
a = "[[Bar]]" | ||
} |
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,3 @@ | ||
a = "[[Foo.Bar]]" | ||
^^^ rbt-markup-string-resolution/potato.trlc:4: error: package must be imported before use | ||
Processed 2 models and 2 requirement files and found 1 error |
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 @@ | ||
rbt-markup-string-resolution/potato.trlc:4:12: trlc error: package must be imported before use |
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,3 @@ | ||
a = "[[Foo.Bar]]" | ||
^^^ rbt-markup-string-resolution/potato.trlc:4: error: package must be imported before use | ||
Processed 2 models and 2 requirement files and found 1 error |
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,3 @@ | ||
a = "[[Foo.Bar]]" | ||
^^^ rbt-markup-string-resolution/potato.trlc:4: error: package must be imported before use | ||
Processed 2 models and 2 requirement files and found 1 error |
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 @@ | ||
package Potato | ||
|
||
type T { | ||
a Markup_String | ||
} |
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 @@ | ||
package Potato | ||
|
||
T Kitten { | ||
a = "[[Foo.Bar]]" | ||
} |
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 @@ | ||
package Foo | ||
|
||
type T { | ||
a Markup_String | ||
} |
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 @@ | ||
package Foo | ||
|
||
T Bar { | ||
a = "[[T]]" | ||
} | ||
|
||
T But { | ||
a = "[[But]]" | ||
} |
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,3 @@ | ||
a = "[[T]]" | ||
^ rbt-markup-string-types/foo.trlc:4: error: Record_Type T is not a Record_Object | ||
Processed 1 model and 1 requirement file and found 1 error |
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 @@ | ||
rbt-markup-string-types/foo.trlc:4:12: trlc error: Record_Type T is not a Record_Object |
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,3 @@ | ||
a = "[[T]]" | ||
^ rbt-markup-string-types/foo.trlc:4: error: Record_Type T is not a Record_Object | ||
Processed 1 model and 1 requirement file and found 1 error |
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,3 @@ | ||
a = "[[T]]" | ||
^ rbt-markup-string-types/foo.trlc:4: error: Record_Type T is not a Record_Object | ||
Processed 1 model and 1 requirement file and found 1 error |
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