aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-06-11 20:15:29 +0100
committerMichael Williamson <mike@zwobble.org>2023-06-11 20:15:29 +0100
commitba2b92bef0ae6beca79e0db6f89cd7471b82e0cb (patch)
tree5df145a7210f484428e27639b7bb76ed44631a4d /src/main/java
parent06f929e6ff57d658060858ab5210ba80cfc336f6 (diff)
Add docs for types
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/shedlang/compiler/types/BoolType.java3
-rw-r--r--src/main/java/org/shedlang/compiler/types/IntType.java3
-rw-r--r--src/main/java/org/shedlang/compiler/types/StringType.java3
-rw-r--r--src/main/java/org/shedlang/compiler/types/UnitType.java4
4 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/org/shedlang/compiler/types/BoolType.java b/src/main/java/org/shedlang/compiler/types/BoolType.java
index 8bf9ed25..0343cc24 100644
--- a/src/main/java/org/shedlang/compiler/types/BoolType.java
+++ b/src/main/java/org/shedlang/compiler/types/BoolType.java
@@ -1,5 +1,8 @@
package org.shedlang.compiler.types;
+/**
+ * The {@code Bool} type, either true or false.
+ */
public final class BoolType implements Type {
private BoolType() {
}
diff --git a/src/main/java/org/shedlang/compiler/types/IntType.java b/src/main/java/org/shedlang/compiler/types/IntType.java
index 01faa16f..c74b8bd2 100644
--- a/src/main/java/org/shedlang/compiler/types/IntType.java
+++ b/src/main/java/org/shedlang/compiler/types/IntType.java
@@ -1,5 +1,8 @@
package org.shedlang.compiler.types;
+/**
+ * The {@code Int} type, representing arbitrary precision integers.
+ */
public final class IntType implements Type {
private IntType() {
}
diff --git a/src/main/java/org/shedlang/compiler/types/StringType.java b/src/main/java/org/shedlang/compiler/types/StringType.java
index eb2374a3..3a20c9bb 100644
--- a/src/main/java/org/shedlang/compiler/types/StringType.java
+++ b/src/main/java/org/shedlang/compiler/types/StringType.java
@@ -1,5 +1,8 @@
package org.shedlang.compiler.types;
+/**
+ * The {@code String} type. Strings are sequences of Unicode code points.
+ */
public final class StringType implements Type {
static final StringType INSTANCE = new StringType();
diff --git a/src/main/java/org/shedlang/compiler/types/UnitType.java b/src/main/java/org/shedlang/compiler/types/UnitType.java
index acc7aad0..db36f226 100644
--- a/src/main/java/org/shedlang/compiler/types/UnitType.java
+++ b/src/main/java/org/shedlang/compiler/types/UnitType.java
@@ -1,5 +1,9 @@
package org.shedlang.compiler.types;
+/**
+ * The {@code Unit} type. Allows only one value, and therefore holds no
+ * information.
+ */
public final class UnitType implements Type {
static final UnitType INSTANCE = new UnitType();