Skip to content

Commit

Permalink
removed all unneeded error blocks from documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Jun 9, 2023
1 parent 3243ddd commit 25406fd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/org/rascalmpl/library/Exception.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ are generated by a throw statement. They can all be caught with a try-catch usin
@examples{
Import relevant libraries:
```rascal-shell,continue,error
```rascal-shell,continue
import Exception;
import IO;
```
Expand All @@ -37,7 +37,7 @@ weekend = ("saturday": 1, "sunday": 2);
weekend["monday"];
```
Repeat this, but catch the exception. We use variable `N` to track what happened:
```rascal-shell,continue,error
```rascal-shell,continue
N = 1;
try {
N = weekend["monday"];
Expand Down
4 changes: 2 additions & 2 deletions src/org/rascalmpl/library/IO.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ List the entries in directory `file`.

#### Examples

```rascal-shell,error
```rascal-shell
import IO;
```
List all entries in the standard library:
```rascal-shell,continue,error
```rascal-shell,continue
listEntries(|std:///|);
```
}
Expand Down
16 changes: 7 additions & 9 deletions src/org/rascalmpl/library/List.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ Get the first element(s) from a list.

#### Examples

```rascal-shell,error
```rascal-shell
import List;
```
Get the first element:
```rascal-shell,continue,error
```rascal-shell,continue
head([1, 2, 3]);
head(["zebra", "elephant", "snake", "owl"]);
```
Expand All @@ -181,7 +181,7 @@ An exception is thrown when taking the head of an empty list:
head([]);
```
Get the first n elements:
```rascal-shell,continue,error
```rascal-shell,continue
head([1, 2, 3, 4], 2);
head(["zebra", "elephant", "snake", "owl"], 2);
```
Expand Down Expand Up @@ -279,7 +279,7 @@ Returns a new list with the value of `elm` inserted at index position `n` of the

#### Examples

```rascal-shell,error
```rascal-shell
import List;
insertAt([1,2,3], 1, 5);
insertAt(["zebra", "elephant", "snake", "owl"], 2, "eagle");
Expand Down Expand Up @@ -819,10 +819,8 @@ Get the tail element(s) from a list.

#### Examples

```rascal-shell,error
```
All but first element:
```rascal-shell,continue,error
```rascal-shell,continue
import List;
tail([10,20,30]);
```
Expand All @@ -831,7 +829,7 @@ Try an error case:
tail([]);
```
Last n elements:
```rascal-shell,continue,error
```rascal-shell,continue
tail([10, 20, 30, 40, 50, 60], 3);
```
Try an error case:
Expand Down Expand Up @@ -950,7 +948,7 @@ Convert a list of tuples to a map; result must be a map.

#### Examples

```rascal-shell,error
```rascal-shell
import List;
toMapUnique([<1,10>, <2, 20>, <3, 30>]);
```
Expand Down
2 changes: 1 addition & 1 deletion src/org/rascalmpl/library/Map.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Also see ((Map-invert)) and ((module:Exception)).
#### Examples
```rascal-shell,error
```rascal-shell
import Map;
invertUnique(("apple": 1, "pear": 2, "orange": 3));
```
Expand Down
2 changes: 1 addition & 1 deletion src/org/rascalmpl/library/Set.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ Convert a set of tuples to a map. The result should be a legal map (i.e., withou

#### Examples

```rascal-shell,error
```rascal-shell
import Set;
toMapUnique({<"a", 1>, <"b", 2>, <"c", 10>});
```
Expand Down
2 changes: 1 addition & 1 deletion src/org/rascalmpl/library/String.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ Throws `IllegalArgument` when `s` cannot be converted.
#### Examples
```rascal-shell,error
```rascal-shell
import String;
toInt("11");
toInt("11", 8);
Expand Down

0 comments on commit 25406fd

Please sign in to comment.