blob: 200c45ec033d64206898bba8d80beac150a689eb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
package coffee.liz.lambda.ast;
/**
* Represents source code in one of the supported lambda calculus syntaxes.
*/
public sealed interface SourceCode {
static SourceCode ofLambda(final String source) {
return new Lambda(source);
}
static SourceCode ofArrow(final String source) {
return new Arrow(source);
}
record Lambda(String source) implements SourceCode {
}
record Arrow(String source) implements SourceCode {
}
/**
* Supported syntax types for {@link SourceCode}.
*/
enum Syntax {
LAMBDA, ARROW
}
}
|