
When an include is not surrounded by empty lines, its content is inlined on the same line as the adjacent content. That can lead to broken tags and other display issues. This PR fixes all such includes and introduces a validation step that forbids introducing the same problem again.
55 lines
1.1 KiB
Plaintext
55 lines
1.1 KiB
Plaintext
== Why is this an issue?
|
|
|
|
When multiple, adjacent ``++MONITOR++`` statements have duplicate ``++ON-ERROR++`` blocks, they should be merged to consolidate the ``++ON-ERROR++`` logic for cleaner, more readable code. Note that this applies even when there is intervening code outside any ``++MONITOR++`` block.
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,rpg]
|
|
----
|
|
/free
|
|
monitor;
|
|
// do something...
|
|
on-error;
|
|
CALLP HandleError(*param);
|
|
endmon;
|
|
|
|
// do un-monitored thing
|
|
|
|
monitor;
|
|
// do something else...
|
|
on-error; // Noncompliant
|
|
CALLP HandleError(*param);
|
|
endmon;
|
|
/end-free
|
|
----
|
|
|
|
=== Compliant solution
|
|
|
|
[source,rpg]
|
|
----
|
|
/free
|
|
monitor;
|
|
// do something...
|
|
// do un-monitored thing
|
|
// do something else...
|
|
on-error;
|
|
CALLP HandleError(*param);
|
|
endmon;
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|