Skip to content

Commit

Permalink
no defaults in CheckPack at all
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Dec 5, 2024
1 parent 29bf6d7 commit 4cc4cc5
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 15 deletions.
28 changes: 14 additions & 14 deletions eo-parser/src/main/java/org/eolang/parser/CheckPack.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,23 @@ public CheckPack(final String scrpt) {
public Collection<String> failures() throws IOException {
final Yaml yaml = new Yaml();
final Map<String, Object> map = yaml.load(this.script);
final String src = map.get("eo").toString();
final Iterable<String> xsls = (Iterable<String>) map.get("xsls");
Train<Shift> train = new TrParsing();
if (xsls != null) {
train = train.empty();
for (final String xsl : xsls) {
if (xsl.startsWith("file://")) {
train = train.with(
new StXSL(
new XSLDocument(Paths.get(xsl.substring(7)))
)
);
} else {
train = train.with(new StClasspath(xsl));
}
if (xsls == null) {
throw new IllegalArgumentException("XSLs are not defined");
}
Train<Shift> train = new TrParsing().empty();
for (final String xsl : xsls) {
if (xsl.startsWith("file://")) {
train = train.with(
new StXSL(
new XSLDocument(Paths.get(xsl.substring(7)))
)
);
} else {
train = train.with(new StClasspath(xsl));
}
}
final String src = map.get("eo").toString();
final XML out = new StrictXML(
new Xsline(train).pass(
new StrictXML(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
xsls:
- /org/eolang/parser/cti-adds-errors.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/wrap-method-calls.xsl
- /org/eolang/parser/expand-qqs.xsl
- /org/eolang/parser/add-probes.xsl
- /org/eolang/parser/vars-float-up.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/expand-aliases.xsl
- /org/eolang/parser/resolve-aliases.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/add-default-package.xsl
- /org/eolang/parser/explicit-data.xsl
- /org/eolang/parser/const-to-dataized.xsl
- /org/eolang/parser/set-locators.xsl
- /org/eolang/parser/clean-up.xsl
tests:
- /program[not(errors)]
- //o[@name='a' and @loc='Φ.org.abc.a']
Expand All @@ -28,7 +44,6 @@ tests:
- //o[@base='x' and @name='tt' and @loc='Φ.org.abc.tt']
- //o[@base='org.eolang.number' and @loc='Φ.org.abc.tt.α0']
- //o[@base='org.eolang.tuple' and @loc='Φ.org.abc.tt.α1']
- //o[@base='org.eolang.number' and @loc='Φ.org.abc.tt.α1.α0.α1']
- //o[@base='org.eolang.number' and @loc='Φ.org.abc.tt.α1.α1']
- //o[not(@base) and @loc='Φ.org.abc.tt.α2']
- //o[@base='∅' and @name='e' and @loc='Φ.org.abc.tt.α2.e']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
xsls:
- /org/eolang/parser/cti-adds-errors.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/wrap-method-calls.xsl
- /org/eolang/parser/expand-qqs.xsl
- /org/eolang/parser/add-probes.xsl
- /org/eolang/parser/vars-float-up.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/expand-aliases.xsl
- /org/eolang/parser/resolve-aliases.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/add-default-package.xsl
- /org/eolang/parser/explicit-data.xsl
- /org/eolang/parser/const-to-dataized.xsl
- /org/eolang/parser/set-locators.xsl
- /org/eolang/parser/clean-up.xsl
tests:
- /program[not(errors)]
- //metas[count(.//meta[head/text()='probe'])=1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
xsls:
- /org/eolang/parser/cti-adds-errors.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/wrap-method-calls.xsl
- /org/eolang/parser/expand-qqs.xsl
- /org/eolang/parser/add-probes.xsl
- /org/eolang/parser/vars-float-up.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/expand-aliases.xsl
- /org/eolang/parser/resolve-aliases.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/add-default-package.xsl
- /org/eolang/parser/explicit-data.xsl
- /org/eolang/parser/const-to-dataized.xsl
- /org/eolang/parser/set-locators.xsl
- /org/eolang/parser/clean-up.xsl
tests:
- /program[not(errors)]
- /program/sheets/sheet[contains(text(),'add-probes')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
xsls:
- /org/eolang/parser/cti-adds-errors.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/wrap-method-calls.xsl
- /org/eolang/parser/expand-qqs.xsl
- /org/eolang/parser/add-probes.xsl
- /org/eolang/parser/vars-float-up.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/expand-aliases.xsl
- /org/eolang/parser/resolve-aliases.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/add-default-package.xsl
- /org/eolang/parser/explicit-data.xsl
- /org/eolang/parser/const-to-dataized.xsl
- /org/eolang/parser/set-locators.xsl
- /org/eolang/parser/clean-up.xsl
tests:
- /program[not(errors)]
- /program[not(metas)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
xsls:
- /org/eolang/parser/cti-adds-errors.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/wrap-method-calls.xsl
- /org/eolang/parser/expand-qqs.xsl
- /org/eolang/parser/add-probes.xsl
- /org/eolang/parser/vars-float-up.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/expand-aliases.xsl
- /org/eolang/parser/resolve-aliases.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/add-default-package.xsl
- /org/eolang/parser/explicit-data.xsl
- /org/eolang/parser/const-to-dataized.xsl
- /org/eolang/parser/set-locators.xsl
- /org/eolang/parser/clean-up.xsl
tests:
- //o[@base='.as-bytes' and @line and @pos and @name='x' and o[@base='org.eolang.dataized' and o[@base='org.eolang.number' and not(@name)]]]
- //o[@base='.as-bytes' and @line and @pos and @name='m' and o[@base='org.eolang.dataized' and o[@name='m-3' and count(o)=2]]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
xsls:
- /org/eolang/parser/cti-adds-errors.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/wrap-method-calls.xsl
- /org/eolang/parser/expand-qqs.xsl
- /org/eolang/parser/add-probes.xsl
- /org/eolang/parser/vars-float-up.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/expand-aliases.xsl
- /org/eolang/parser/resolve-aliases.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/add-default-package.xsl
- /org/eolang/parser/explicit-data.xsl
- /org/eolang/parser/const-to-dataized.xsl
- /org/eolang/parser/set-locators.xsl
- /org/eolang/parser/clean-up.xsl
tests:
- /program[not(errors)]
- //o[@name='foo' and count(o)=2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
xsls:
- /org/eolang/parser/cti-adds-errors.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/wrap-method-calls.xsl
- /org/eolang/parser/expand-qqs.xsl
- /org/eolang/parser/add-probes.xsl
- /org/eolang/parser/vars-float-up.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/expand-aliases.xsl
- /org/eolang/parser/resolve-aliases.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/add-default-package.xsl
- /org/eolang/parser/explicit-data.xsl
- /org/eolang/parser/const-to-dataized.xsl
- /org/eolang/parser/set-locators.xsl
- /org/eolang/parser/clean-up.xsl
tests:
- /program[not(errors)]
- /program/objects[count(o)=1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
xsls:
- /org/eolang/parser/cti-adds-errors.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/wrap-method-calls.xsl
- /org/eolang/parser/expand-qqs.xsl
- /org/eolang/parser/add-probes.xsl
- /org/eolang/parser/vars-float-up.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/expand-aliases.xsl
- /org/eolang/parser/resolve-aliases.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/add-default-package.xsl
- /org/eolang/parser/explicit-data.xsl
- /org/eolang/parser/const-to-dataized.xsl
- /org/eolang/parser/set-locators.xsl
- /org/eolang/parser/clean-up.xsl
tests:
- /program[not(errors)]
- //o[@base='.plus']/o[@base='.value']/o[contains(@base,'other')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
xsls:
- /org/eolang/parser/cti-adds-errors.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/wrap-method-calls.xsl
- /org/eolang/parser/expand-qqs.xsl
- /org/eolang/parser/add-probes.xsl
- /org/eolang/parser/vars-float-up.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/expand-aliases.xsl
- /org/eolang/parser/resolve-aliases.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/add-default-package.xsl
- /org/eolang/parser/explicit-data.xsl
- /org/eolang/parser/const-to-dataized.xsl
- /org/eolang/parser/set-locators.xsl
- /org/eolang/parser/clean-up.xsl
tests:
- /program[not(errors)]
- //o[@base='.plus']/o[@base='.a']/o[@base='^']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
xsls:
- /org/eolang/parser/cti-adds-errors.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/wrap-method-calls.xsl
- /org/eolang/parser/expand-qqs.xsl
- /org/eolang/parser/add-probes.xsl
- /org/eolang/parser/vars-float-up.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/expand-aliases.xsl
- /org/eolang/parser/resolve-aliases.xsl
- /org/eolang/parser/add-refs.xsl
- /org/eolang/parser/add-default-package.xsl
- /org/eolang/parser/explicit-data.xsl
- /org/eolang/parser/const-to-dataized.xsl
- /org/eolang/parser/set-locators.xsl
- /org/eolang/parser/clean-up.xsl
tests:
- /program[not(errors)]
- //o[@name='f' and @line='8']
Expand Down

0 comments on commit 4cc4cc5

Please sign in to comment.