1
1
mirror of https://github.com/anoma/juvix.git synced 2024-09-11 08:15:41 +03:00
juvix/tests/positive
Paul Cadman 52a3eed162
Support extract-module-statements attribute in juvix code blocks (#2734)
This PR adds support for the `extract-module-statements` attribute for
Juvix code blocks:

So if you write something like the following block in a Juvix markdown
file:

````
```juvix extract-module-statements
module Foo;
   type T := t;
end;
```
````

The statement `type T := t;` from the body of the module is rendered in
the output. The `module Foo;` , and `end;` lines are not rendered in the
output.

A block with the `extract-module-statements` must contain a single local
module statement and nothing else. An error is reported if this is not
the case.

The `extract-module-statements` attribute also takes an optional
argument. It sets the number of statements from the module body to drop
from the output.

In the following example, the output will contain the single line `a : T
:= t;`.

````
```juvix extract-module-statements 1
module Foo;
   type T := t;
   a : T  := t;
end;
```
````

---------

Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
2024-04-18 17:01:59 +01:00
..
265 Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
272 Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
BuiltinsMultiImport Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
BuiltinsMultiOpenImport Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
Dependencies Extract builtin definitions for loading a Package into bundled package-base package (#2535) 2023-11-30 16:22:18 +00:00
FancyPaths Extract builtin definitions for loading a Package into bundled package-base package (#2535) 2023-11-30 16:22:18 +00:00
ImportAsOpen Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
ImportNestedLocalModule Transitively register local modules in ScoperState (#2655) 2024-02-16 14:09:49 +00:00
Imports Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
ImportShadow Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
InstanceImport Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
Internal Per-module compilation (#2468) 2023-12-30 20:15:35 +01:00
issue1333 Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
issue1466 Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
issue1693 Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
issue1731 Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
issue1879 Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
issue2163 Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
issue2248 Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
issue2296 Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
issue2373 Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
Markdown Support extract-module-statements attribute in juvix code blocks (#2734) 2024-04-18 17:01:59 +01:00
MarkdownImport Extract builtin definitions for loading a Package into bundled package-base package (#2535) 2023-11-30 16:22:18 +00:00
NoDependencies Extract builtin definitions for loading a Package into bundled package-base package (#2535) 2023-11-30 16:22:18 +00:00
package Extract builtin definitions for loading a Package into bundled package-base package (#2535) 2023-11-30 16:22:18 +00:00
PackageLoader Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
PackageLoaderV2 Extract builtin definitions for loading a Package into bundled package-base package (#2535) 2023-11-30 16:22:18 +00:00
QualifiedConstructor Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
QualifiedImports Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
QualifiedSymbol Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
QualifiedSymbol2 Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
Reachability Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
StdlibImport Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
StdlibList Per-module compilation (#2468) 2023-12-30 20:15:35 +01:00
Termination Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
UsingHiding Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
VisibilityPrecendence Correctly resolve the visibility annotations of NameSpaceEntries (#2657) 2024-02-16 18:26:01 +01:00
Adt.juvix Improve formatting of single-constructor types and records (#2342) 2023-09-07 16:20:14 +02:00
Alias.juvix Fix formatting for all Juvix files in tests folder (#2404) 2023-10-31 18:36:34 +01:00
AliasRecordConstructor.juvix Use the target of aliases when resolving name signatures and iterators (#2669) 2024-02-26 11:53:47 +00:00
Ape.juvix New fixity/iterator syntax (#2332) 2023-09-14 10:57:38 +02:00
Axiom.juvix Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
Builtins.juvix Format juvix files using new function syntax (#2245) 2023-07-11 17:22:07 +02:00
BuiltinsBool.juvix Format juvix files using new function syntax (#2245) 2023-07-11 17:22:07 +02:00
ConstructorWildcard.juvix Improve formatting of function definition arguments (#2551) 2023-12-07 11:26:48 +01:00
DefaultValues.juvix Improve formatting of function definition arguments (#2551) 2023-12-07 11:26:48 +01:00
Format.juvix Fix typos (#2573) 2024-01-08 13:27:18 +01:00
FormatPragma.juvix Remove old function syntax (#2305) 2023-08-24 16:24:47 +02:00
HoleTypeParameter.juvix Fix for crash with wildcard used in type definition (#2405) 2023-10-02 18:58:21 +02:00
IdInType.juvix Fix formatting for all Juvix files in tests folder (#2404) 2023-10-31 18:36:34 +01:00
Inductive.juvix Improve formatting of single-constructor types and records (#2342) 2023-09-07 16:20:14 +02:00
InductivePipes.juvix Improve formatting of single-constructor types and records (#2342) 2023-09-07 16:20:14 +02:00
InstanceAxiom.juvix Fix instance axiom bug (#2439) 2023-10-10 15:55:17 +02:00
Iterators.juvix Per-module compilation (#2468) 2023-12-30 20:15:35 +01:00
Judoc.juvix Improve formatting of single-constructor types and records (#2342) 2023-09-07 16:20:14 +02:00
LambdaCalculus.juvix Fix formatting for all Juvix files in tests folder (#2404) 2023-10-31 18:36:34 +01:00
LetOpen.juvix Allow open statements in let expressions (#2395) 2023-10-02 23:13:45 +02:00
LetShadow.juvix Fix formatting for all Juvix files in tests folder (#2404) 2023-10-31 18:36:34 +01:00
Literals.juvix Format juvix files using new function syntax (#2245) 2023-07-11 17:22:07 +02:00
LocalModWithAxiom.juvix Fix #2495 (#2496) 2023-11-03 21:23:57 +01:00
LocalModWithAxiom.juvix.formatted Fix #2495 (#2496) 2023-11-03 21:23:57 +01:00
LocalSynonym.juvix Fix formatting for all Juvix files in tests folder (#2404) 2023-10-31 18:36:34 +01:00
MultiParams.juvix Improve formatting of single-constructor types and records (#2342) 2023-09-07 16:20:14 +02:00
MutualLet.juvix Remove old function syntax (#2305) 2023-08-24 16:24:47 +02:00
MutualType.juvix Fix remove unexpected whitespaces introduced by formatting (#2489) 2023-11-03 12:51:45 +01:00
NamedArguments.juvix Fix formatting for all Juvix files in tests folder (#2404) 2023-10-31 18:36:34 +01:00
Namespaces.juvix Separate modules namespace (#2257) 2023-07-26 09:59:50 +02:00
NestedPatterns.juvix Fix formatting for all Juvix files in tests folder (#2404) 2023-10-31 18:36:34 +01:00
OmitType.juvix Remove old function syntax (#2305) 2023-08-24 16:24:47 +02:00
Operators.juvix New fixity/iterator syntax (#2332) 2023-09-14 10:57:38 +02:00
Package.juvix Add PackageDescription.Basic module Package variant (#2509) 2023-11-13 17:36:18 +00:00
Parsing.juvix Format juvix files using new function syntax (#2245) 2023-07-11 17:22:07 +02:00
Polymorphism.juvix Fix formatting for all Juvix files in tests folder (#2404) 2023-10-31 18:36:34 +01:00
PolymorphismHoles.juvix Fix formatting for all Juvix files in tests folder (#2404) 2023-10-31 18:36:34 +01:00
Pragmas.juvix Format juvix files using new function syntax (#2245) 2023-07-11 17:22:07 +02:00
Projections.juvix Literal casting (#2457) 2023-11-03 10:01:03 +01:00
RecordPattern.juvix Fix formatting for all Juvix files in tests folder (#2404) 2023-10-31 18:36:34 +01:00
Records2.juvix Literal casting (#2457) 2023-11-03 10:01:03 +01:00
Records.juvix Improve formatting of single-constructor types and records (#2342) 2023-09-07 16:20:14 +02:00
ShadowPublicOpen.juvix Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
SignatureWithBody.juvix Remove old function syntax (#2305) 2023-08-24 16:24:47 +02:00
Symbols.juvix User-friendly operator declaration syntax (#2270) 2023-08-09 18:15:51 +02:00
Syntax.juvix Per-module compilation (#2468) 2023-12-30 20:15:35 +01:00
Traits2.juvix Improve formatting of function definition arguments (#2551) 2023-12-07 11:26:48 +01:00
Traits.juvix Fix formatting for all Juvix files in tests folder (#2404) 2023-10-31 18:36:34 +01:00
TypeAlias.juvix Fix formatting for all Juvix files in tests folder (#2404) 2023-10-31 18:36:34 +01:00
WildcardArguments.juvix Allow wildcard arguments in new function definition syntax (#2295) 2023-08-16 17:51:09 +02:00