mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-23 08:18:04 +03:00
commit
84e6446f31
@ -302,7 +302,7 @@ ucmCommand = do
|
||||
fenced :: P Stanza
|
||||
fenced = do
|
||||
fence
|
||||
fenceType <- lineToken (word "ucm" <|> word "unison" <|> lineUntilSpace)
|
||||
fenceType <- lineToken(word "ucm" <|> word "unison" <|> language)
|
||||
stanza <-
|
||||
if fenceType == "ucm" then do
|
||||
hide <- hidden
|
||||
@ -381,8 +381,8 @@ expectingError = isJust <$> optional (word ":error")
|
||||
untilSpace1 :: P Text
|
||||
untilSpace1 = P.takeWhile1P Nothing (not . Char.isSpace)
|
||||
|
||||
lineUntilSpace :: P Text
|
||||
lineUntilSpace = P.takeWhileP Nothing (\ch -> ch `elem` (" \t" :: String))
|
||||
language :: P Text
|
||||
language = P.takeWhileP Nothing (\ch -> Char.isDigit ch || Char.isLower ch || ch == '_' )
|
||||
|
||||
spaces :: P ()
|
||||
spaces = void $ P.takeWhileP (Just "spaces") Char.isSpace
|
||||
|
37
unison-src/transcripts/transcript-parser-commands.md
Normal file
37
unison-src/transcripts/transcript-parser-commands.md
Normal file
@ -0,0 +1,37 @@
|
||||
### Transcript parser operations
|
||||
|
||||
The transcript parser is meant to parse `ucm` and `unison` blocks.
|
||||
|
||||
```unison
|
||||
x = 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
.> add
|
||||
```
|
||||
|
||||
```unison:hide:error:scratch.u
|
||||
z
|
||||
```
|
||||
|
||||
```ucm:error
|
||||
.> delete foo
|
||||
```
|
||||
|
||||
```ucm :error
|
||||
.> delete lineToken.call
|
||||
```
|
||||
|
||||
However handling of blocks of other languages should be supported.
|
||||
|
||||
```python
|
||||
some python code
|
||||
```
|
||||
|
||||
```c_cpp
|
||||
some C++ code
|
||||
```
|
||||
|
||||
```c9search
|
||||
some cloud9 code
|
||||
```
|
75
unison-src/transcripts/transcript-parser-commands.output.md
Normal file
75
unison-src/transcripts/transcript-parser-commands.output.md
Normal file
@ -0,0 +1,75 @@
|
||||
### Transcript parser operations
|
||||
|
||||
The transcript parser is meant to parse `ucm` and `unison` blocks.
|
||||
|
||||
```unison
|
||||
x = 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
|
||||
I found and typechecked these definitions in scratch.u. If you
|
||||
do an `add` or `update`, here's how your codebase would
|
||||
change:
|
||||
|
||||
⍟ These new definitions are ok to `add`:
|
||||
|
||||
x : Nat
|
||||
|
||||
Now evaluating any watch expressions (lines starting with
|
||||
`>`)... Ctrl+C cancels.
|
||||
|
||||
```
|
||||
```ucm
|
||||
.> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
||||
x : Nat
|
||||
|
||||
```
|
||||
```unison
|
||||
---
|
||||
title: :scratch.u
|
||||
---
|
||||
z
|
||||
|
||||
```
|
||||
|
||||
|
||||
```ucm
|
||||
.> delete foo
|
||||
|
||||
⚠️
|
||||
|
||||
I don't know about that name.
|
||||
|
||||
```
|
||||
```ucm
|
||||
.> delete lineToken.call
|
||||
|
||||
⚠️
|
||||
|
||||
I don't know about that name.
|
||||
|
||||
```
|
||||
However handling of blocks of other languages should be supported.
|
||||
|
||||
```python
|
||||
|
||||
some python code
|
||||
|
||||
```
|
||||
|
||||
```c_cpp
|
||||
|
||||
some C++ code
|
||||
|
||||
```
|
||||
|
||||
```c9search
|
||||
|
||||
some cloud9 code
|
||||
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user