Tabbing a block of TLA+ doesn't preserve indentation of conjunct and disjunct lists
See original GitHub issuePut(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:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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:
Given that
editor.useTabStops
is on by default, our extension should probably raise a warning.