From 3ffa0296a6a3251931b65dcf6c5f560c9e3b9b10 Mon Sep 17 00:00:00 2001 From: Roman Korostinskiy <70313618+c71n93@users.noreply.github.com> Date: Wed, 20 Mar 2024 17:52:00 +0300 Subject: [PATCH 1/2] #2984 add xsl check for atoms without +rt --- .../{rt-without-atom.xsl => rt-and-atoms.xsl} | 28 +++++++++++++------ .../catches/catches-atoms-without-rt.yaml | 14 ++++++++++ .../catches/catches-rt-without-atoms.yaml | 2 +- 3 files changed, 35 insertions(+), 9 deletions(-) rename eo-parser/src/main/resources/org/eolang/parser/errors/{rt-without-atom.xsl => rt-and-atoms.xsl} (72%) create mode 100644 eo-parser/src/test/resources/org/eolang/parser/packs/catches/catches-atoms-without-rt.yaml diff --git a/eo-parser/src/main/resources/org/eolang/parser/errors/rt-without-atom.xsl b/eo-parser/src/main/resources/org/eolang/parser/errors/rt-and-atoms.xsl similarity index 72% rename from eo-parser/src/main/resources/org/eolang/parser/errors/rt-without-atom.xsl rename to eo-parser/src/main/resources/org/eolang/parser/errors/rt-and-atoms.xsl index 8eb0bc9128..880ba4cfd0 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/errors/rt-without-atom.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/errors/rt-and-atoms.xsl @@ -22,20 +22,32 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --> - - + - - + + + + + rt-and-atoms + + + + + + error + + Using atoms without +rt meta + + + + + - rt-without-atoms + rt-and-atoms diff --git a/eo-parser/src/test/resources/org/eolang/parser/packs/catches/catches-atoms-without-rt.yaml b/eo-parser/src/test/resources/org/eolang/parser/packs/catches/catches-atoms-without-rt.yaml new file mode 100644 index 0000000000..090505622f --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/packs/catches/catches-atoms-without-rt.yaml @@ -0,0 +1,14 @@ +xsls: + - /org/eolang/parser/errors/rt-and-atoms.xsl +tests: + - /program/errors[count(error[@severity='error'])=1] +eo: | + +architect yegor256@gmail.com + +home https://github.com/objectionary/eo + +package org.eolang + +version 0.0.0 + + # Bytes. + [] > bytes + # Equals to another object. + [x] > eq /bool diff --git a/eo-parser/src/test/resources/org/eolang/parser/packs/catches/catches-rt-without-atoms.yaml b/eo-parser/src/test/resources/org/eolang/parser/packs/catches/catches-rt-without-atoms.yaml index f423cdbd57..4cc5cd8735 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/packs/catches/catches-rt-without-atoms.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/packs/catches/catches-rt-without-atoms.yaml @@ -1,5 +1,5 @@ xsls: - - /org/eolang/parser/errors/rt-without-atom.xsl + - /org/eolang/parser/errors/rt-and-atoms.xsl tests: - /program/errors[count(error[@severity='error'])=1] eo: | From 51068d26534ce9f8982fe0d042458690528df639 Mon Sep 17 00:00:00 2001 From: Roman Korostinskiy <70313618+c71n93@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:07:28 +0300 Subject: [PATCH 2/2] #2948 fix error message --- .../main/resources/org/eolang/parser/errors/rt-and-atoms.xsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eo-parser/src/main/resources/org/eolang/parser/errors/rt-and-atoms.xsl b/eo-parser/src/main/resources/org/eolang/parser/errors/rt-and-atoms.xsl index 880ba4cfd0..46594d8810 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/errors/rt-and-atoms.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/errors/rt-and-atoms.xsl @@ -39,7 +39,7 @@ SOFTWARE. error - Using atoms without +rt meta + Using atoms without +rt meta is prohibited @@ -55,7 +55,7 @@ SOFTWARE. error - Using +rt meta without atoms + Using +rt meta without atoms is prohibited