Skip to content

Commit 18346a9

Browse files
authored
Merge branch 'objectionary:master' into 3941-resolve-it
2 parents 5ac3374 + 8c2d901 commit 18346a9

124 files changed

Lines changed: 239 additions & 420 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ mvn clean install -Pqulice
316316
```
317317

318318
You will need [Maven 3.3+](https://maven.apache.org) and Java 11+ installed.
319+
Also, if you have [xcop](https://github.com/yegor256/xcop) installed, make sure
320+
it is version `0.8.0`+.
319321

320322
## Special thanks
321323

REUSE.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ path = [
3232
"Gemfile.lock",
3333
"eo-maven-plugin/src/main/resources/org/eolang/maven/latex/latex-template.txt",
3434
"eo-maven-plugin/src/test/resources/org/eolang/maven/commits/tags.txt",
35-
"eo-runtime/src/main/resources/org/eolang/version.txt",
35+
"eo-runtime/src/main/resources/org/eolang/version.txt"
3636
]
3737
precedence = "override"
3838
SPDX-FileCopyrightText = "Copyright (c) 2016-2025 Objectionary.com"

eo-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<dependency>
2424
<groupId>org.eolang</groupId>
2525
<artifactId>lints</artifactId>
26-
<version>0.0.38</version>
26+
<version>0.0.39</version>
2727
</dependency>
2828
<dependency>
2929
<groupId>org.glassfish</groupId>

eo-maven-plugin/src/main/java/org/eolang/maven/LintMojo.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,16 @@ private static String summary(final ConcurrentHashMap<Severity, Integer> counts)
257257
* @param xmir The XML before linting
258258
* @param counts Counts of errors, warnings, and critical
259259
* @return XML after linting
260+
* @todo #3934:35min Remove .without() from Program to enable `unknown-metas`
261+
* and `unsorted-metas` lints. Currently we disabled them since lints does not
262+
* support `+spdx` meta yet. Once <a href="https://github.com/objectionary/lints/issues/354">this</a>
263+
* issue will be resolved, we should enable all lints.
260264
*/
261265
private static XML linted(final XML xmir, final ConcurrentHashMap<Severity, Integer> counts) {
262266
final Directives dirs = new Directives();
263-
final Collection<Defect> defects = new Program(xmir).defects();
267+
final Collection<Defect> defects = new Program(xmir).without(
268+
"unknown-metas", "unsorted-metas"
269+
).defects();
264270
if (!defects.isEmpty()) {
265271
dirs.xpath("/program").addIf("errors").strict(1);
266272
LintMojo.embed(xmir, defects);

eo-maven-plugin/src/test/resources/org/eolang/maven/mess.eo

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com
2-
# SPDX-License-Identifier: MIT
3-
1+
+spdx SPDX-FileCopyrightText Copyright (c) 2016-2025 Objectionary.com
2+
+spdx SPDX-License-Identifier: MIT
43
+alias org.eolang.io.stdout
54
+architect yegor256@gmail.com
65
+home https://github.com/objectionary/eo

eo-parser/src/main/antlr4/org/eolang/parser/Eo.g4

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,13 @@ tokens { TAB, UNTAB }
88

99
// Entry point
1010
program
11-
: license? metas? objects EOF
11+
: metas? objects EOF
1212
;
1313

1414
// Double EOL
1515
eop : EOL EOL
1616
;
1717

18-
// Licence
19-
license
20-
: (COMMENTARY EOL)* COMMENTARY eop
21-
;
22-
2318
// Metas
2419
metas
2520
: (META EOL)* META eop

eo-parser/src/main/java/org/eolang/parser/XeEoListener.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
import org.antlr.v4.runtime.tree.ErrorNode;
1717
import org.antlr.v4.runtime.tree.TerminalNode;
1818
import org.apache.commons.text.StringEscapeUtils;
19-
import org.cactoos.iterable.Mapped;
20-
import org.cactoos.text.Joined;
2119
import org.xembly.Directive;
2220
import org.xembly.Directives;
2321

@@ -104,24 +102,6 @@ public void exitEop(final EoParser.EopContext ctx) {
104102
// Nothing here
105103
}
106104

107-
@Override
108-
public void enterLicense(final EoParser.LicenseContext ctx) {
109-
this.dirs.addIf("license").set(
110-
new Joined(
111-
"\n",
112-
new Mapped<>(
113-
cmt -> cmt.getText().substring(1).trim(),
114-
ctx.COMMENTARY()
115-
)
116-
)
117-
).up();
118-
}
119-
120-
@Override
121-
public void exitLicense(final EoParser.LicenseContext ctx) {
122-
// Nothing here
123-
}
124-
125105
@Override
126106
public void enterMetas(final EoParser.MetasContext ctx) {
127107
this.dirs.addIf("metas");

eo-parser/src/main/resources/XMIR.xsd

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<xs:documentation>
1010
Every XMIR document is essentially an XML document that
1111
contains objects found in a EOLANG program together with
12-
supplementary information, such as metas, license, and so on.
12+
supplementary information, such as metas, and so on.
1313
The schema is used to validate the XMIR documents, which are
1414
generated by the EO parser. The schema defines the structure
1515
of the XMIR document, including the elements and attributes
@@ -252,21 +252,6 @@
252252
<xs:extension base="non-empty"/>
253253
</xs:simpleContent>
254254
</xs:complexType>
255-
<xs:complexType name="license">
256-
<xs:annotation>
257-
<xs:appinfo>The entire license found in the source code</xs:appinfo>
258-
<xs:documentation>
259-
The element contains the entire text of the license found in the source code. This information is crucial for
260-
understanding the legal terms under which the code can be used, modified, and distributed. By including the full
261-
license text, developers and users can easily reference the licensing terms without needing to look up the
262-
original source. This practice helps ensure compliance with the license and provides transparency regarding the
263-
legal framework governing the code.
264-
</xs:documentation>
265-
</xs:annotation>
266-
<xs:simpleContent>
267-
<xs:extension base="non-empty"/>
268-
</xs:simpleContent>
269-
</xs:complexType>
270255
<xs:simpleType name="sheet">
271256
<xs:annotation>
272257
<xs:appinfo>The XSL stylesheet that was applied to the XMIR</xs:appinfo>
@@ -375,7 +360,6 @@
375360
</xs:sequence>
376361
</xs:complexType>
377362
</xs:element>
378-
<xs:element name="license" type="license" minOccurs="0"/>
379363
<xs:element name="metas" minOccurs="0">
380364
<xs:complexType>
381365
<xs:sequence>

eo-parser/src/test/resources/org/eolang/parser/eo-syntax/full-syntax.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
sheets: [ ]
55
asserts:
66
- /program[not(errors)]
7-
- /program/license[text()!='']
87
- /program/metas[count(meta)=4]
98
- /program/metas/meta[head='foo' and tail='']
109
- //o[@base='Q.org.eolang.true']
@@ -18,10 +17,6 @@ asserts:
1817
- //o[@atom and @name='atom' and count(o)=2 and o[@name='a']]
1918
- //o[@atom='org.eolang.number']
2019
input: |
21-
# The purpose of this test case is to make
22-
# sure all possible syntax scenarios can
23-
# be parsed by the ANTLR
24-
2520
+alias org.example.foo
2621
+alias Test Test
2722
+bar Some text

eo-parser/src/test/resources/org/eolang/parser/eo-syntax/leap-year.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ asserts:
77
- /program/objects[count(o)=1]
88
- //o[@base='.and']
99
input: |
10-
# This program is from the EOLANG original paper
11-
# and must produce a working command line tool
12-
#
13-
# License is MIT
14-
1510
+alias org.eolang.io.stdin
1611
+alias org.eolang.io.stdout
1712
+alias org.eolang.txt.scanner

0 commit comments

Comments
 (0)