Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script execution: adjust line numbers #159

Merged
merged 2 commits into from
Jun 11, 2024
Merged

Conversation

mpollmeier
Copy link
Owner

before this change:

echo 'val i: Int = "Hello!"' > foo.sc
./srp --script foo.sc

executing foo.sc
-- [E007] Type Mismatch Error:
/tmp/scala-repl-pp-script-with-predef2026848595210523554.sc:8:15
8 |  val i: Int = "Hello!"
  |               ^^^^^^^^
  |               Found:    ("Hello!" : String)
  |               Required: Int

with this change:

echo 'val i: Int = "Hello!"' > foo.sc
./srp --script foo.sc

executing foo.sc
-- [E007] Type Mismatch Error: /tmp/wrapped-script16126559910573703929.sc:1:15 -
1 |  val i: Int = "Hello!"
  |               ^^^^^^^^
  |               Found:    ("Hello!" : String)
  |               Required: Int

works for most cases... not all though:

echo 'println("Hello!"' > foo.sc
./srp --script foo.sc

executing test-simple.sc
-- [E040] Syntax Error: /tmp/wrapped-script12034823679540823317.sc:3:0
---------
3 |}}
  |^
  |')' expected, but '}' found

before this change:
```bash
echo 'val i: Int = "Hello!"' > foo.sc
./srp --script foo.sc

executing foo.sc
-- [E007] Type Mismatch Error:
/tmp/scala-repl-pp-script-with-predef2026848595210523554.sc:8:15
8 |  val i: Int = "Hello!"
  |               ^^^^^^^^
  |               Found:    ("Hello!" : String)
  |               Required: Int
```

with this change:
```bash
echo 'val i: Int = "Hello!"' > foo.sc
./srp --script foo.sc

executing foo.sc
-- [E007] Type Mismatch Error: /tmp/wrapped-script16126559910573703929.sc:1:15 -
1 |  val i: Int = "Hello!"
  |               ^^^^^^^^
  |               Found:    ("Hello!" : String)
  |               Required: Int
```

works for most cases... not all though:
```bash
echo 'println("Hello!"' > foo.sc
./srp --script foo.sc

executing test-simple.sc
-- [E040] Syntax Error: /tmp/wrapped-script12034823679540823317.sc:3:0
---------
3 |}}
  |^
  |')' expected, but '}' found
```
@mpollmeier mpollmeier requested a review from maltek June 6, 2024 15:10
@mpollmeier mpollmeier merged commit 27ccead into main Jun 11, 2024
3 checks passed
@max-leuthaeuser max-leuthaeuser deleted the michael/script-line-numbers branch August 2, 2024 07:59
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.

2 participants