-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
119 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.immutables.grammar; | ||
|
||
public interface Sterm { | ||
|
||
public interface Factory { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,27 @@ | ||
package io.immutables.lang.type; | ||
|
||
public final class Name implements CharSequence { | ||
private final String string; | ||
import org.immutables.value.Value.Default; | ||
import org.immutables.value.Value.Immutable; | ||
import org.immutables.value.Value.Parameter; | ||
|
||
private Name(String string) { | ||
this.string = string; | ||
@Immutable(singleton = true, builder = false, copy = false) | ||
public abstract class Name { | ||
@Parameter | ||
@Default | ||
String value() { | ||
return ""; | ||
} | ||
|
||
public static Name empty() { | ||
return EMPTY; | ||
} | ||
|
||
public static Name of(CharSequence name) { | ||
if (name.length() == 0) return EMPTY; | ||
return new Name(name.toString()); | ||
return ImmutableName.of(); | ||
} | ||
|
||
@Override | ||
public Name subSequence(int begin, int end) { | ||
return of(string.substring(begin, end)); | ||
public static Name of(String value) { | ||
return ImmutableName.of(value); | ||
} | ||
|
||
public boolean isEmpty() { | ||
return this == EMPTY; | ||
return value().isEmpty(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return string; | ||
} | ||
|
||
@Override | ||
public int length() { | ||
return string.length(); | ||
return value(); | ||
} | ||
|
||
@Override | ||
public char charAt(int index) { | ||
return string.charAt(index); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
return other instanceof Name | ||
? ((Name) other).string.equals(string) | ||
: false; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return string.hashCode(); | ||
} | ||
|
||
private static final Name EMPTY = new Name(""); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.immutables.lang.type; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public interface Scope { | ||
|
||
class Builder { | ||
private final Map<Name, Type> types = new HashMap<>(); | ||
private final Map<Name, Type.Concept> concepts = new HashMap<>(); | ||
|
||
public Builder put(Name name, Type type) { | ||
types.put(name, type); | ||
return this; | ||
} | ||
|
||
public Builder add(Name name, Type.Concept concept) { | ||
concepts.put(name, concept); | ||
return this; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.immutables.lang.type; | ||
|
||
import org.junit.Test; | ||
|
||
public class TestType { | ||
@Test | ||
public void test() { | ||
|
||
} | ||
} |
Oops, something went wrong.