question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tabbing a block of TLA+ doesn't preserve indentation of conjunct and disjunct lists

See original GitHub issue

Peek 2021-07-10 14-50

Put(t, d) ==
/\ t \notin waitSet
\* The Producer t must not have initiated its termination.
/\ prod[t] = Cardinality(C)
/\ \/ /\ Len(buffer) < B
      /\ buffer' = Append(buffer, d)
      /\ NotifyOther(t)
   \/ /\ Len(buffer) = B
      /\ Wait(t)
/\ UNCHANGED <<prod,cons>>

vs

Put(t, d) ==
    /\ t \notin waitSet
    \* The Producer t must not have initiated its termination.
    /\ prod[t] = Cardinality(C)
    /\ \/ /\ Len(buffer) < B
        /\ buffer' = Append(buffer, d)
        /\ NotifyOther(t)
    \/ /\ Len(buffer) = B
        /\ Wait(t)
    /\ UNCHANGED <<prod,cons>>

Fortunately in this case, SANY caught it:

Parsing file /home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/BlockingQueuePoisonApple.tla
***Parse Error***

  Precedence conflict between ops \lor in block line 124, col 5 to line 124, col 6 of module BlockingQueuePoisonApple and \land.

Residual stack trace follows:
ExtendableExpr starting at line 124, column 8.
ExtendableExpr starting at line 118, column 5.
Expression starting at line 118, column 5.
Definition starting at line 117, column 1.
Module body starting at line 7, column 1.


Fatal errors while parsing TLA+ spec in file BlockingQueuePoisonApple

tla2sany.semantic.AbortException
*** Abort messages: 1

In module BlockingQueuePoisonApple

Could not parse module BlockingQueuePoisonApple from file BlockingQueuePoisonApple.tla


Starting... (2021-07-10 14:43:26)
Error: Parsing or semantic analysis failed.
Finished in 00s at (2021-07-10 14:43:26)

FWIW: The (Eclipse-based) Toolbox does the right thing when tabbing. 😃

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
johnyfcommented, Aug 21, 2021

It appears that when the VSCode editor configuration option “Use Tab Stops” is unticked, then a uniform amount of indentation is inserted across a set of selected lines, when pressing the tab key. This editor option is described in VSCode as:

inserting and deleting whitespace follows tab stops

0reactions
lemmycommented, Aug 21, 2021

Given that editor.useTabStops is on by default, our extension should probably raise a warning.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tabbing a block of TLA+ doesn't preserve indentation ... - GitHub
In this case VSCode indents each line independently, and indentation on Tab pressing means "move to the next nearest position that corresponds ...
Read more >
Can't indent heredoc to match code block's indentation
The script sends email without issues, but the mailx command is nested within an if statement so I appear to be left with...
Read more >
Control indentation with Org–Babel - python - Stack Overflow
@Tobias When I org-babel-tangle the file, indentation is not respected given a whitespace prefix with the #+begin_src environment. Everything is alright if I ......
Read more >
https://conservancy.umn.edu/bitstream/handle/11299...
Context-Aware Scanning and Determinism-Preserving Grammar Composition, in Theory and ... which is done by a block of code that reads a list of...
Read more >
ftp.cs.stanford.edu/pub/mirrors/ubuntu/dists/xenia...
It does not provide many features over and above RDF storage and SPARQL ... airport-hostmon: wireless hosts monitor, lists wireless hosts connected to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found