1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-07 16:22:14 +03:00
juvix/tests/positive/Judoc.juvix
Jan Mas Rovira 9b1011b8ad
Add syntax for Judoc blocks (#2102)
- Closes #2050 

This pr adds the possibility to give judoc documentation in blocks
delimited by `{--` and `--}`.
- Inside these blocks, normal comments are disabled.
- It is allowed to have multiple blocks associated with the same
identifier, e.g.
```
{-- an axiom --}
{-- of type ;Type; --}
axiom a : Type;
```
- Nested blocks are *not* allowed.
- Blocks can be empty: `{-- --}`.
- The formatter respects line breaks inside blocks.
- The formatter normalizes whitespace at both ends of the block to a
single whitespace.
2023-05-19 14:05:32 +02:00

45 lines
600 B
Plaintext

module Judoc;
axiom A : Type;
axiom b : Type;
--- document type
type T :=
| --- document constructor
t : T;
--- blah ;id A; and ;A A id T A id; this is another ;id
id
id; example
--- hahahah
--- and another one ;T;
id : {A : Type} → A → A;
id a := a;
--- hellowww
{-- judoc block --}
{-- judoc
block --}
{-- -- --}
{-- --}
{-- f
z ;Type; --}
id2 : {A : Type} → A → A;
id2 a := a;
id2 a := a;
-- }
--- testing double minus --
--- testing triple --- minus
--- testing closing --}.
---
--- second paragraph
axiom B : {A : Type} → A → A;
{-- Hi
Bye
end --}
axiom M : Type;