Skip to content

Conversation

@wfouche
Copy link
Member

@wfouche wfouche commented Sep 5, 2025

Closes #3

$ jbang run ../JythonCli.java  --cli-debug banner.py

[jbang] Building jar for JythonCli.java...

TOML data in Jython script:
     5 :# /// jbang
     6 :# requires-jython = "2.7.4"
     7 :# requires-java = "21"
     8 :# dependencies = [
     9 :#   "io.leego:banana:2.1.0"
    10 :# ]
    11 :# runtime-options = [
    12 :#   "-Dpython.console.encoding=UTF-8"
    13 :# ]
    14 :# ///

TOML data extracted from Jython script:
     1 :requires-jython = "2.7.4"
     2 :requires-java = "21"
     3 :dependencies = [
     4 :  "io.leego:banana:2.1.0"
     5 :]
     6 :runtime-options = [
     7 :  "-Dpython.console.encoding=UTF-8"
     8 :]

JBang command-line parameters:
    jbang
    run
    --java
      24
    --runtime-option
      -Dpython.console.encoding=UTF-8
    --deps
      io.leego:banana:2.1.0
    --main
      org.python.util.jython
    org.python:jython-slim:2.7.4
    banner.py

['banner.py']

@wfouche
Copy link
Member Author

wfouche commented Sep 5, 2025

Error reporting is improved as well when an invalid TOML data block is parsed.

$ jbang run ../JythonCli.java  --cli-debug banner.py

TOML data in Jython script:
     5 :# /// jbang
     6 :# requires-jython = "2.7.4"
     7 :# requires-java = "21"
     8 :# dependencies = [
     9 :#   "io.leego:banana:2.1.0"
    10 :# ]
    11 :# runtime-options = [
    12 :#   "-Dpython.console.encoding=UTF-8"
    13 :# ///

TOML data extracted from Jython script:
     1 :requires-jython = "2.7.4"
     2 :requires-java = "21"
     3 :dependencies = [
     4 :  "io.leego:banana:2.1.0"
     5 :]
     6 :runtime-options = [
     7 :  "-Dpython.console.encoding=UTF-8"
Unexpected end of input, expected ], a comma, or a newline (line 7, column 36)
java.io.IOException

@wfouche
Copy link
Member Author

wfouche commented Sep 5, 2025

@jeff5 , apologies for the delay in resubmitting the changes that got lost in the pull request fiasco.

@wfouche wfouche changed the title Improved formatting of debug output Improved error reporting and formatting of debug output Sep 5, 2025
@wfouche
Copy link
Member Author

wfouche commented Oct 2, 2025

I'll close this PR, and resubmit it as two distinct PRs

@wfouche wfouche closed this Oct 2, 2025
@wfouche wfouche deleted the dev/toml-parsing branch October 11, 2025 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parser weak at diagnosing specification errors

1 participant