Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Incomplete code in tut sheds doesn't fail #65

Closed
ceedubs opened this issue Aug 24, 2015 · 4 comments · Fixed by #220
Closed

Incomplete code in tut sheds doesn't fail #65

ceedubs opened this issue Aug 24, 2015 · 4 comments · Fixed by #220
Milestone

Comments

@ceedubs
Copy link
Contributor

ceedubs commented Aug 24, 2015

Discovered in version 0.4.0.

If a tut shed ends when a normal REPL would prompt for more input, tut doesn't complain that the code is incomplete.

example input (I'm using apostophes because I can't figure out how to escape backticks in GitHub markdown):

'''tut
{
'''

what I see in output:

scala>   {

I seem to forget closing braces and hit this often :)

Edit: I had been using tut:silent a lot and forgot that tut includes the scala> prompt in the output, so I wrote an irrelevant detail.

@tpolecat
Copy link
Owner

dammit

@zakpatterson
Copy link

zakpatterson commented Nov 2, 2016

I think fixing this would break my use case, where I would like to be able to guarantee that an expensive expression compiles for my document generation, but I don't want the calculation to run.

... at the end of this great paragraph, we have this example code:
```tut:invisible
object compileNotRun{
``` 
```tut:book
bigSparkThing map veryExpensiveComputation
``` 
```tut:invisible
}
```  

(For @ceedubs: I wrapped the whole thing in a shed, but the parser will treat the closing shed you intend to have printed as closing the whole thing, but only if it's alone on a new line, so the closing ```s are followed by unicode 00A0 (non-breaking-space). The parser also trims regular spaces from lines so just using a space key space doesn't work.)

@tpolecat
Copy link
Owner

tpolecat commented Nov 2, 2016

Seems like a pretty specialized use case ... I'm inclined to say use a def or something if you don't want to evaluate an expression. Most of the time leaving one open is a bug.

@zakpatterson
Copy link

Sounds reasonable, think my doc would read ok with the example in a def. If the feature is ever supported it would make sense in its own Modifier

tpolecat added a commit that referenced this issue Mar 28, 2018
Fix #65: assure incomplete input doesn't pass compilation
felixmulder added a commit to felixmulder/sbt-microsites that referenced this issue Mar 29, 2018
Tut 0.6.4 adds a fix for tpolecat/tut#65, which
makes sure that incomplete input does not pass compilation
juanpedromoreno pushed a commit to 47degrees/sbt-microsites that referenced this issue Mar 30, 2018
Tut 0.6.4 adds a fix for tpolecat/tut#65, which
makes sure that incomplete input does not pass compilation
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants