id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
27292418_23
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/pattern/StructMatchTest.java", "identifier": "StructMatchTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldBindStructMatch() {\n VariableType t = t(0);\n Scope scope = mock(Scope.class);\n when(scope.reserveType()).thenReturn(t);\n PatternMatch struct = struct(\"(,)\", t, asList(\n field(\"_0\", t, capture(\"a\", t(1))),\n field(\"_1...
{ "fields": [ { "declarator": "sourceLocation", "modifier": "@Getter\n private final", "original_string": "@Getter\n private final SourceLocation sourceLocation;", "type": "SourceLocation", "var_name": "sourceLocation" }, { "declarator": "argument", "modi...
{ "body": "@Override\n public PatternMatch bind(Value argument, Scope scope) {\n return withArgument(argument).map(field -> field.bind(argument, scope));\n }", "class_method_signature": "StructMatch.bind(Value argument, Scope scope)", "constructor": false, "full_signature": "@Override public Patter...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_3
{ "fields": [], "file": "scotch-core/src/test/java/me/qmx/jitescript/JiteClassTest.java", "identifier": "JiteClassTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFields() throws Exception {\n JiteClass jiteClass = new JiteClass(\"testFields\", p(Object.class), new String[0]) {{\n defineField(\"foo\", ACC_PUBLIC | ACC_STATIC, ci(String.class), \"bar\");\n }};\n\n Class<?> clazz = new DynamicClassLoader().def...
{ "fields": [ { "declarator": "INTERFACES = new String[]{}", "modifier": "public static final", "original_string": "public static final String[] INTERFACES = new String[]{};", "type": "String[]", "var_name": "INTERFACES" }, { "declarator": "methods = new ArrayList<Metho...
{ "body": "public FieldDefinition defineField(String fieldName, int modifiers, String signature, Object value) {\n FieldDefinition field = new FieldDefinition(fieldName, modifiers, signature, value);\n this.fields.add(field);\n return field;\n }", "class_method_signature": "JiteClass.defineF...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_74
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformListDestructuringPattern() {\n transform(\n \"module scotch.test\",\n \"tail (_:xs) = xs\"\n );\n shouldHavePattern(\"scotch.test.(#0)\",\n asList(capture(\"tail\", t(0)), unshuffledMatch(t(1), ignore(t(2)), equal(i...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_54
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformExpressionsToUnshuffledValues() {\n transform(\n \"module scotch.test\",\n \"value = fn (a b)\"\n );\n shouldHaveValue(\"scotch.test.value\", unshuffled(\n id(\"fn\", t(0)),\n unshuffled(id(\"a\", t(1)), ...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_42
{ "fields": [ { "declarator": "exception = none()", "modifier": "@Rule public final", "original_string": "@Rule public final ExpectedException exception = none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "resolver", "modifier": "@M...
{ "body": "@Test\n public void shouldGetNothingWhenQualifyingQualifiedSymbolThatHasUnimportedModuleName() {\n assertThat(moduleScope.qualify(qualified(\"scotch.external\", \"fn\")), is(Optional.empty()));\n }", "class_method_signature": "ModuleScopeTest.shouldGetNothingWhenQualifyingQualifiedSymbolThat...
{ "fields": [ { "declarator": "importScopes", "modifier": "private final", "original_string": "private final List<ImportScope> importScopes;", "type": "List<ImportScope>", "var_name": "importScopes" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/scope/Modu...
{ "body": "@Override\n public Optional<Symbol> qualify(Symbol symbol) {\n Optional<Symbol> optionalSymbol = importScopes.stream()\n .map(importScope -> importScope.qualify_(symbol))\n .filter(Optional::isPresent)\n .map(Optional::get)\n .findFirst();\n if (...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_15
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldNotUnifySumToTargetVariable_whenSumDoesNotImplementEntireVariableContext() {\n VariableType target = var(\"a\", asList(\"Eq\", \"Show\"));\n Type sum = sum(\"DbCursor\");\n addContext(sum, \"Show\");\n shouldBeContextMismatch(unify(target, sum), targ...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_81
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldDestructureToast() {\n transform(\n \"module scotch.test\",\n \"data Toast { kind :: String, burnLevel :: Int }\",\n \"isBurned? Toast { burnLevel = b } = b > 3\"\n );\n shouldHavePattern(\"scotch.test.(#1)\",\n a...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_39
{ "fields": [ { "declarator": "exception = none()", "modifier": "@Rule public final", "original_string": "@Rule public final ExpectedException exception = none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "resolver", "modifier": "@M...
{ "body": "@Test\n public void leavingChildScopeShouldGiveBackModuleScope() {\n assertThat(moduleScope.enterScope(emptyList()).leaveScope(), sameInstance(moduleScope));\n }", "class_method_signature": "ModuleScopeTest.leavingChildScopeShouldGiveBackModuleScope()", "constructor": false, "full_signat...
{ "fields": [ { "declarator": "importScopes", "modifier": "private final", "original_string": "private final List<ImportScope> importScopes;", "type": "List<ImportScope>", "var_name": "importScopes" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/scope/Modu...
{ "body": "@Override\n public Scope enterScope(List<Import> imports) {\n ImportScope scope = new ImportScope(this, new DefaultTypeScope(symbolGenerator, resolver), resolver, symbolGenerator, moduleName, ImmutableList.<Import>builder()\n .add(moduleImport(NULL_SOURCE, \"scotch.lang\"))\n ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_78
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldCreateDataConstructorValue() {\n transform(\n \"module scotch.test\",\n \"data Toast {\",\n \" type :: Bread,\",\n \" butter :: Bool,\",\n \" jam :: Bool\",\n \"}\"\n );\n shouldHave...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_79
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldCreateConstantForNiladicConstructor() {\n transform(\n \"module scotch.test\",\n \"data Maybe a = Nothing | Just a\"\n );\n shouldHaveValue(\"scotch.test.Nothing\", constantRef(\n \"scotch.test.Nothing\",\n \"scot...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_38
{ "fields": [ { "declarator": "exception = none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "parentScope", "m...
{ "body": "@Test\n public void shouldGetContextFromParent() {\n when(parentScope.getContext(intType())).thenReturn(ImmutableSet.of(symbol(\"scotch.data.num.Num\")));\n assertThat(childScope.getContext(intType()), contains(\n symbol(\"scotch.data.num.Num\")\n ));\n }", "class_me...
{ "fields": [ { "declarator": "children", "modifier": "private final", "original_string": "private final Set<ChildScope> children;", "type": "Set<ChildScope>", "var_name": "children" }, { "declarator": "captures", "modifier": "private final", "original_strin...
{ "body": "@Override\n public Set<Symbol> getContext(Type type) {\n return ImmutableSet.<Symbol>builder()\n .addAll(types.getContext(type))\n .addAll(parent.getContext(type))\n .build();\n }", "class_method_signature": "ChildScope.getContext(Type type)", "constructor"...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_80
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldCreateDataConstructorWithAnonymousFields() {\n transform(\n \"module scotch.test\",\n \"data Maybe a = Nothing | Just a\"\n );\n shouldHaveValue(\"scotch.test.Just\", fn(\n \"scotch.test.(#0)\",\n asList(arg(\"_0\...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_14
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldMutuallyExtendContexts_whenUnifyingVariables() {\n VariableType a = var(\"a\", asList(\"Eq\"));\n VariableType b = var(\"b\", asList(\"Show\"));\n unify(b, a);\n shouldBeBound(a, var(\"b\", asList(\"Eq\", \"Show\")));\n shouldBeBound(b, var(\"...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_43
{ "fields": [ { "declarator": "exception = none()", "modifier": "@Rule public final", "original_string": "@Rule public final ExpectedException exception = none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "resolver", "modifier": "@M...
{ "body": "@Test\n public void shouldThrow_whenGettingContext() {\n exception.expect(IllegalStateException.class);\n moduleScope.getContext(intType());\n }", "class_method_signature": "ModuleScopeTest.shouldThrow_whenGettingContext()", "constructor": false, "full_signature": "@Test public vo...
{ "fields": [ { "declarator": "importScopes", "modifier": "private final", "original_string": "private final List<ImportScope> importScopes;", "type": "List<ImportScope>", "var_name": "importScopes" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/scope/Modu...
{ "body": "@Override\n public Set<Symbol> getContext(Type type) {\n throw new IllegalStateException();\n }", "class_method_signature": "ModuleScope.getContext(Type type)", "constructor": false, "full_signature": "@Override public Set<Symbol> getContext(Type type)", "identifier": "getContext", "...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_55
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformPatternSignature() {\n transform(\n \"module scotch.test\",\n \"length :: String -> Int\"\n );\n shouldHaveSignature(\"scotch.test.length\", fn(sum(\"String\"), sum(\"Int\")));\n }", "class_method_signature": "SyntaxTrans...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_75
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldParseParenthesizedCapturePattern() {\n transform(\n \"module scotch.test\",\n \"second (_, (b)) = b\"\n );\n shouldHavePattern(\"scotch.test.(#0)\",\n asList(capture(\"second\", t(0)), struct(\"scotch.data.tuple.(,)\", t(1),...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_2
{ "fields": [], "file": "scotch-core/src/test/java/me/qmx/jitescript/JiteClassTest.java", "identifier": "JiteClassTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void superclassHashNondefaultConstructor() throws IllegalAccessException, InstantiationException {\n String className = \"Sub\";\n String superClass = p(NondefaultConstructor.class);\n JiteClass jiteClass = new JiteClass(className, superClass, new String[]{}) {{\n ...
{ "fields": [ { "declarator": "INTERFACES = new String[]{}", "modifier": "public static final", "original_string": "public static final String[] INTERFACES = new String[]{};", "type": "String[]", "var_name": "INTERFACES" }, { "declarator": "methods = new ArrayList<Metho...
{ "body": "public void defineDefaultConstructor() {\n defineDefaultConstructor(ACC_PUBLIC);\n }", "class_method_signature": "JiteClass.defineDefaultConstructor()", "constructor": false, "full_signature": "public void defineDefaultConstructor()", "identifier": "defineDefaultConstructor", "invocatio...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_22
{ "fields": [ { "declarator": "scope", "modifier": "private", "original_string": "private DefaultTypeScope scope;", "type": "DefaultTypeScope", "var_name": "scope" } ], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/ConstructorTypeTest.java", "identifier...
{ "body": "@Test\n public void shouldReplaceConstructorsWithSumsAsTheyAreInferenced() {\n scope.implement(symbol(\"Monad\"), sum(\"Either\", var(\"a\")));\n Type function = fn(ctor(t(9, asList(\"Monad\")), t(10)), fn(fn(t(10), ctor(t(9, asList(\"Monad\")), t(11))), ctor(t(9, asList(\"Monad\")), t(11)...
{ "fields": [ { "declarator": "head", "modifier": "private final", "original_string": "private final Type head;", "type": "Type", "var_name": "head" }, { "declarator": "tail", "modifier": "private final", "original_string": "private final Type tail;", ...
{ "body": "@Override\n protected Type generate(TypeScope scope, Set<Type> visited) {\n return new ConstructorType(head.generate(scope, visited), tail.generate(scope, visited)).flatten();\n }", "class_method_signature": "ConstructorType.generate(TypeScope scope, Set<Type> visited)", "constructor": fal...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_34
{ "fields": [ { "declarator": "resolver", "modifier": "@Mock\n private", "original_string": "@Mock\n private SymbolResolver resolver;", "type": "SymbolResolver", "var_name": "resolver" }, { "declarator": "symbolGenerator", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void shouldBeEmpty_whenQualifyingUndeclaredSymbol() {\n assertThat(rootScope.qualify(qualified(\"scotch.module1\", \"fn\")), is(Optional.empty()));\n }", "class_method_signature": "RootScopeTest.shouldBeEmpty_whenQualifyingUndeclaredSymbol()", "constructor": false, "full_s...
{ "fields": [ { "declarator": "symbolGenerator", "modifier": "private final", "original_string": "private final SymbolGenerator symbolGenerator;", "type": "SymbolGenerator", "var_name": "symbolGenerator" }, { "declarator": "resolver", "modifier": "private final...
{ "body": "@Override\n public Optional<Symbol> qualify(Symbol symbol) {\n return symbol.accept(new SymbolVisitor<Optional<Symbol>>() {\n @Override\n public Optional<Symbol> visit(QualifiedSymbol symbol) {\n if (resolver.isDefined(symbol)) {\n return Op...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_63
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformMultiArgFunctionLiteral() {\n transform(\n \"module scotch.test\",\n \"apply = \\\\x y -> x y\"\n );\n shouldHaveValue(\"scotch.test.apply\", matcher(\"scotch.test.(apply#0)\", t(0), asList(arg(\"#0\", t(3)), arg(\"#1\", t(4))...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_18
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldNotUnifySumsWhenArgumentsDiffer() {\n SumType list1 = sum(\"List\", asList(toType(Int.TYPE)));\n SumType list2 = sum(\"List\", asList(toType(Bool.TYPE)));\n shouldBeMismatch(unify(list1, list2), toType(Int.TYPE), toType(Bool.TYPE));\n }", "class_method...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_59
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformPatternSignatureWithParameterizedVariable() {\n transform(\n \"module scotch.test\",\n \"(>>=) :: m a -> (a -> m b) -> m b\"\n );\n shouldHaveSignature(\"scotch.test.(>>=)\", fn(ctor(var(\"m\"), var(\"a\")), fn(fn(var(\"a\"), ...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_52
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformRoot() {\n transform(\n \"module a.b.c\",\n \"module x.y.z\"\n );\n shouldHaveDefinition(rootRef(), root(asList(\n moduleRef(\"a.b.c\"),\n moduleRef(\"x.y.z\")\n )));\n }", "class_method_signa...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_44
{ "fields": [ { "declarator": "exception = none()", "modifier": "@Rule public final", "original_string": "@Rule public final ExpectedException exception = none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "resolver", "modifier": "@M...
{ "body": "@Test\n public void shouldDelegateQualifiedSymbolsToRoot() {\n Symbol symbol = qualified(\"scotch.external\", \"fn\");\n moduleScope.qualify(symbol);\n verify(rootScope).qualify(symbol);\n }", "class_method_signature": "ModuleScopeTest.shouldDelegateQualifiedSymbolsToRoot()", ...
{ "fields": [ { "declarator": "importScopes", "modifier": "private final", "original_string": "private final List<ImportScope> importScopes;", "type": "List<ImportScope>", "var_name": "importScopes" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/scope/Modu...
{ "body": "@Override\n public Optional<Symbol> qualify(Symbol symbol) {\n Optional<Symbol> optionalSymbol = importScopes.stream()\n .map(importScope -> importScope.qualify_(symbol))\n .filter(Optional::isPresent)\n .map(Optional::get)\n .findFirst();\n if (...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_13
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldNotUnifyBoundVariableWithFunction() {\n Type variable = var(\"a\");\n Type function = fn(sum(\"String\"), sum(\"Bool\"));\n Type target = sum(\"Int\");\n unify(variable, target);\n shouldBeMismatch(unify(variable, function), target, function);...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_68
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformsDoNotationWithBind() {\n transform(\n \"module scotch.test\",\n \"pingpong = do\",\n \" ping <- readln\",\n \" println (\\\"ponging back! \\\" ++ ping)\"\n );\n shouldHaveValue(\"scotch.test.pingpo...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_87
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/parser/SymbolTransformerTest.java", "identifier": "SymbolTransformerTest", "interfaces": "", "superclass": "extends ScotchParserBaseTest" }
{ "body": "@Test\n public void shouldTransformQualifiedType() {\n ParserRuleContext ctx = parseTree(ScotchParser::qualifiedType, \"scotch.test.Type\");\n assertThat(new SymbolTransformer().getSymbol(ctx), is(qualified(\"scotch.test\", \"Type\")));\n }", "class_method_signature": "SymbolTransform...
{ "fields": [], "file": "scotch-compiler/src/main/java/scotch/compiler/parser/SymbolTransformer.java", "identifier": "SymbolTransformer", "interfaces": "", "methods": [ { "class_method_signature": "SymbolTransformer.defaultResult()", "constructor": false, "full_signature": "@Override pub...
{ "body": "public Symbol getSymbol(ParserRuleContext ctx) {\n return ctx.accept(this)\n .orElseThrow(() -> new TransformException(\"Could not get symbol from \" + ctx.getClass().getSimpleName()));\n }", "class_method_signature": "SymbolTransformer.getSymbol(ParserRuleContext ctx)", "construct...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_9
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldUnifyVariables() {\n Type target = fn(var(\"a\"), sum(\"Int\"));\n Type query = fn(var(\"b\"), sum(\"Int\"));\n shouldBeUnified(unify(target, query), target);\n shouldBeBound(argumentOf(query), argumentOf(target));\n }", "class_method_signature"...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_29
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file":...
{ "body": "@Test\n public void shouldDestructureTupleAndTagValues() {\n // second (_, b) = b\n String tuple2 = \"scotch.data.tuple.(,)\";\n Value pattern = matcher(\"scotch.test.second\", t(1), arg(\"#0\", t(2)),\n pattern(\"scotch.test.(second#0)\",\n asList(struct(a...
{ "fields": [ { "declarator": "generator", "modifier": "private final", "original_string": "private final SymbolGenerator generator;", "type": "SymbolGenerator", "var_name": "generator" }, { "declarator": "patterns", "modifier": "private final", "origina...
{ "body": "private PatternState pattern() {\n return patterns.peek();\n }", "class_method_signature": "DefaultPatternReducer.pattern()", "constructor": false, "full_signature": "private PatternState pattern()", "identifier": "pattern", "invocations": [ "peek" ], "modifiers": "private", "...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_91
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/analyzer/TypeCheckerTest.java", "identifier": "TypeCheckerTest", "interfaces": "", "superclass": "extends IsolatedCompilerTest" }
{ "body": "@Test\n public void shouldAnalyzeMultiTypeClassExpression() {\n compile(\n \"module scotch.test\",\n \"import scotch.data.eq\",\n \"import scotch.data.num\",\n \"fn a b = a + b == b + a\"\n );\n shouldNotHaveErrors();\n Type bool = ...
{ "fields": [ { "declarator": "mark = new Object()", "modifier": "private static final", "original_string": "private static final Object mark = new Object();", "type": "Object", "var_name": "mark" }, { "declarator": "graph", "modifier": "private final", "ori...
{ "body": "public Scope scope() {\n return scopes.peek();\n }", "class_method_signature": "TypeChecker.scope()", "constructor": false, "full_signature": "public Scope scope()", "identifier": "scope", "invocations": [ "peek" ], "modifiers": "public", "parameters": "()", "return": "Scope...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_48
{ "fields": [ { "declarator": "resolver", "modifier": "private", "original_string": "private ClassLoaderResolver resolver;", "type": "ClassLoaderResolver", "var_name": "resolver" } ], "file": "scotch-compiler/src/test/java/scotch/compiler/ClassLoaderResolverTest.java", "ide...
{ "body": "@Test\n public void shouldResolveJavaTypeInstanceByModuleName() {\n assertThat(resolver.getTypeInstancesByModule(\"scotch.data.num\"), hasItem(typeInstance(\n \"scotch.data.num\",\n \"scotch.data.num.Num\",\n asList(intType()),\n MethodSignature.fromMet...
{ "fields": [ { "declarator": "optionalOutputPath", "modifier": "private final", "original_string": "private final Optional<File> optionalOutputPath;", "type": "Optional<File>", "var_name": "optionalOutputPath" }, ...
{ "body": "@Override\n public Set<TypeInstanceDescriptor> getTypeInstancesByModule(String moduleName) {\n search(moduleName);\n return typeInstancesByModule.getOrDefault(moduleName, ImmutableSet.of());\n }", "class_method_signature": "ClassLoaderResolver.getTypeInstancesByModule(String moduleNam...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_64
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformIgnoringFunctionLiteral() {\n transform(\n \"module scotch.test\",\n \"fn = \\\\_ -> 3\"\n );\n shouldHaveValue(\"scotch.test.fn\", matcher(\"scotch.test.(fn#0)\", t(0), arg(\"#0\", t(2)),\n pattern(\"scotch.test.(f...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_33
{ "fields": [ { "declarator": "resolver", "modifier": "@Mock\n private", "original_string": "@Mock\n private SymbolResolver resolver;", "type": "SymbolResolver", "var_name": "resolver" }, { "declarator": "symbolGenerator", "modifier": "@Mock\n private", ...
{ "body": "@Test(expected = IllegalStateException.class)\n public void shouldThrow_whenLeavingScope() {\n rootScope.leaveScope();\n }", "class_method_signature": "RootScopeTest.shouldThrow_whenLeavingScope()", "constructor": false, "full_signature": "@Test(expected = IllegalStateException.class) pu...
{ "fields": [ { "declarator": "symbolGenerator", "modifier": "private final", "original_string": "private final SymbolGenerator symbolGenerator;", "type": "SymbolGenerator", "var_name": "symbolGenerator" }, { "declarator": "resolver", "modifier": "private final...
{ "body": "@Override\n public Scope leaveScope() {\n throw new IllegalStateException(\"Can't leave root scope\");\n }", "class_method_signature": "RootScope.leaveScope()", "constructor": false, "full_signature": "@Override public Scope leaveScope()", "identifier": "leaveScope", "invocations": [...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_25
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file":...
{ "body": "@Test\n public void shouldCreateIfAndElseForPattern() {\n // empty? [] = true\n // empty? _ = false\n Value pattern = matcher(\"scotch.test.(empty?)\", t(1), arg(\"#0\", t(2)),\n pattern(\"scotch.test.(empty?#0)\",\n asList(equal(arg(\"#0\", t(3)), id(\"[]...
{ "fields": [ { "declarator": "generator", "modifier": "private final", "original_string": "private final SymbolGenerator generator;", "type": "SymbolGenerator", "var_name": "generator" }, { "declarator": "patterns", "modifier": "private final", "origina...
{ "body": "private PatternState pattern() {\n return patterns.peek();\n }", "class_method_signature": "DefaultPatternReducer.pattern()", "constructor": false, "full_signature": "private PatternState pattern()", "identifier": "pattern", "invocations": [ "peek" ], "modifiers": "private", "...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_5
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldPropagateSumTypeIntoVariableType() {\n Type target = sum(\"String\");\n Type variable = var(\"a\");\n shouldBeUnified(unify(target, variable), target);\n shouldBeBound(variable, target);\n }", "class_method_signature": "TypeTest.shouldPropagateS...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_72
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformListLiteral() {\n transform(\n \"module scotch.test\",\n \"list = [1, 2]\"\n );\n shouldHaveValue(\"scotch.test.list\", initializer(t(3), id(\"scotch.data.list.(:)\", t(4)), asList(\n field(\"_0\", unshuffled(litera...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_73
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformTupleDestructuringPattern() {\n transform(\n \"module scotch.test\",\n \"second (_, b) = b\"\n );\n shouldHavePattern(\"scotch.test.(#0)\",\n asList(capture(\"second\", t(0)), struct(\"scotch.data.tuple.(,)\", t(1),...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_4
{ "fields": [], "file": "scotch-core/src/test/java/me/qmx/jitescript/JiteClassTest.java", "identifier": "JiteClassTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalAccessException.class)\n public void testPrivateConstructor() throws Exception {\n JiteClass jiteClass = new JiteClass(\"Test\", new String[0]) {{\n defineDefaultConstructor(ACC_PRIVATE);\n }};\n\n Class<?> clazz = new DynamicClassLoader().define(j...
{ "fields": [ { "declarator": "INTERFACES = new String[]{}", "modifier": "public static final", "original_string": "public static final String[] INTERFACES = new String[]{};", "type": "String[]", "var_name": "INTERFACES" }, { "declarator": "methods = new ArrayList<Metho...
{ "body": "public void defineDefaultConstructor() {\n defineDefaultConstructor(ACC_PUBLIC);\n }", "class_method_signature": "JiteClass.defineDefaultConstructor()", "constructor": false, "full_signature": "public void defineDefaultConstructor()", "identifier": "defineDefaultConstructor", "invocatio...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_24
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file":...
{ "body": "@Test\n public void shouldReduceCapturesToLets() {\n // max a b = a b\n Value pattern = matcher(\"scotch.test.max\", t(1), asList(arg(\"#0\", t(2)), arg(\"#1\", t(3))),\n pattern(\n \"scotch.test.(max#0)\",\n asList(capture(arg(\"#0\", t(10)), \"a\"...
{ "fields": [ { "declarator": "generator", "modifier": "private final", "original_string": "private final SymbolGenerator generator;", "type": "SymbolGenerator", "var_name": "generator" }, { "declarator": "patterns", "modifier": "private final", "origina...
{ "body": "private PatternState pattern() {\n return patterns.peek();\n }", "class_method_signature": "DefaultPatternReducer.pattern()", "constructor": false, "full_signature": "private PatternState pattern()", "identifier": "pattern", "invocations": [ "peek" ], "modifiers": "private", "...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_32
{ "fields": [ { "declarator": "resolver", "modifier": "@Mock\n private", "original_string": "@Mock\n private SymbolResolver resolver;", "type": "SymbolResolver", "var_name": "resolver" }, { "declarator": "symbolGenerator", "modifier": "@Mock\n private", ...
{ "body": "@Test(expected = IllegalStateException.class)\n public void shouldThrow_whenGettingOperator() {\n rootScope.getOperator(qualified(\"scotch.module1\", \"+\"));\n }", "class_method_signature": "RootScopeTest.shouldThrow_whenGettingOperator()", "constructor": false, "full_signature": "@Test...
{ "fields": [ { "declarator": "symbolGenerator", "modifier": "private final", "original_string": "private final SymbolGenerator symbolGenerator;", "type": "SymbolGenerator", "var_name": "symbolGenerator" }, { "declarator": "resolver", "modifier": "private final...
{ "body": "@Override\n public Optional<Operator> getOperator(Symbol symbol) {\n throw new IllegalStateException();\n }", "class_method_signature": "RootScope.getOperator(Symbol symbol)", "constructor": false, "full_signature": "@Override public Optional<Operator> getOperator(Symbol symbol)", "ide...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_65
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformConditional() {\n transform(\n \"module scotch.test\",\n \"really? = if True then \\\"Yes\\\"\",\n \" else if Maybe then \\\"Maybe\\\"\",\n \" else \\\"Nope\\\"\"\n );\n shouldHaveValue(...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_49
{ "fields": [ { "declarator": "resolver", "modifier": "private", "original_string": "private ClassLoaderResolver resolver;", "type": "ClassLoaderResolver", "var_name": "resolver" } ], "file": "scotch-compiler/src/test/java/scotch/compiler/ClassLoaderResolverTest.java", "ide...
{ "body": "@Test\n public void shouldResolveDataType() {\n assertThat(resolver.getEntry(symbol(\"scotch.data.maybe.Maybe\")).get().getDataType(), is(Optional.of(dataType(\n \"scotch.data.maybe.Maybe\",\n asList(toType(var(\"a\"))),\n asList(\n constructor(\n ...
{ "fields": [ { "declarator": "optionalOutputPath", "modifier": "private final", "original_string": "private final Optional<File> optionalOutputPath;", "type": "Optional<File>", "var_name": "optionalOutputPath" }, ...
{ "body": "@Override\n public Optional<SymbolEntry> getEntry(Symbol symbol) {\n search(symbol);\n if (namedSymbols.containsKey(symbol)) {\n return Optional.ofNullable(namedSymbols.get(symbol));\n } else {\n return symbol.accept(new SymbolVisitor<Optional<SymbolEntry>>() {...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_90
{ "fields": [ { "declarator": "graph", "modifier": "private", "original_string": "private IntermediateGraph graph;", "type": "IntermediateGraph", "var_name": "graph" } ], "file": "scotch-compiler/src/test/java/scotch/compiler/intermediate/IntermediateGeneratorTest.java", "i...
{ "body": "@Test\n public void shouldGenerateNullaryConstructor() {\n compile(\n \"module scotch.test\",\n \"data Maybe a = Nothing | Just a\"\n );\n assertThat(graph.getDefinition(dataRef(symbol(\"scotch.test.Maybe\"))),\n is(Optional.of(data(\"scotch.test.May...
{ "fields": [ { "declarator": "graph", "modifier": "private final", "original_string": "private final DefinitionGraph graph;", "type": "DefinitionGraph", "var_name": "graph" }, { "declarator": "definitions", "modifier": "private final", "origina...
{ "body": "public IntermediateValue constantReference(Symbol symbol, Symbol dataType, FieldSignature constantField) {\n return Intermediates.constantReference(symbol, dataType, constantField);\n }", "class_method_signature": "IntermediateGenerator.constantReference(Symbol symbol, Symbol dataType, FieldSig...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_28
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file":...
{ "body": "@Test\n public void shouldAddAssignmentsWithinCondition() {\n // oneAndVar 1 n = n\n Value pattern = matcher(\"scotch.test.oneAndVar\", t(1), asList(arg(\"#0\", t(2)), arg(\"#1\", t(3))),\n pattern(\"scotch.test.(oneAndVar#0)\",\n asList(\n equa...
{ "fields": [ { "declarator": "generator", "modifier": "private final", "original_string": "private final SymbolGenerator generator;", "type": "SymbolGenerator", "var_name": "generator" }, { "declarator": "patterns", "modifier": "private final", "origina...
{ "body": "private PatternState pattern() {\n return patterns.peek();\n }", "class_method_signature": "DefaultPatternReducer.pattern()", "constructor": false, "full_signature": "private PatternState pattern()", "identifier": "pattern", "invocations": [ "peek" ], "modifiers": "private", "...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_8
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldGiveCircularReference_whenUnifyingFunctionWithContainedVariable() {\n Type target = fn(sum(\"Bit\"), var(\"a\"));\n Type variable = var(\"a\");\n shouldBeCircular(unify(target, variable), target, variable);\n }", "class_method_signature": "TypeTest.sho...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_69
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldThrow_whenBindIsLastLineInDoNotation() {\n exception.expectMessage(containsString(\"Unexpected bind in do-notation\"));\n transform(\n \"module scotch.test\",\n \"pingpong = do\",\n \" ping <- readln\",\n \" printl...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_86
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/parser/SymbolTransformerTest.java", "identifier": "SymbolTransformerTest", "interfaces": "", "superclass": "extends ScotchParserBaseTest" }
{ "body": "@Test\n public void shouldTransformQualifiedName() {\n ParserRuleContext ctx = parseTree(ScotchParser::qualifiedName, \"scotch.test.name\");\n assertThat(new SymbolTransformer().getSymbol(ctx), is(qualified(\"scotch.test\", \"name\")));\n }", "class_method_signature": "SymbolTransform...
{ "fields": [], "file": "scotch-compiler/src/main/java/scotch/compiler/parser/SymbolTransformer.java", "identifier": "SymbolTransformer", "interfaces": "", "methods": [ { "class_method_signature": "SymbolTransformer.defaultResult()", "constructor": false, "full_signature": "@Override pub...
{ "body": "public Symbol getSymbol(ParserRuleContext ctx) {\n return ctx.accept(this)\n .orElseThrow(() -> new TransformException(\"Could not get symbol from \" + ctx.getClass().getSimpleName()));\n }", "class_method_signature": "SymbolTransformer.getSymbol(ParserRuleContext ctx)", "construct...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_12
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldNotUnifyUnionWithFunction() {\n Type union = sum(\"Int\");\n Type function = fn(sum(\"String\"), sum(\"Int\"));\n shouldBeMismatch(unify(union, function), union, function);\n }", "class_method_signature": "TypeTest.shouldNotUnifyUnionWithFunction()", ...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_45
{ "fields": [ { "declarator": "resolver", "modifier": "private", "original_string": "private ClassLoaderResolver resolver;", "type": "ClassLoaderResolver", "var_name": "resolver" } ], "file": "scotch-compiler/src/test/java/scotch/compiler/ClassLoaderResolverTest.java", "ide...
{ "body": "@Test\n public void shouldResolveJavaSymbol() {\n TypeDescriptor a = var(\"a\", asList(\"scotch.data.num.Num\"));\n SymbolEntry entry = resolver.getEntry(symbol(\"scotch.data.num.(+)\")).get();\n\n assertThat(entry.getValue(), is(Optional.of(fn(a, fn(a, a)))));\n assertThat(e...
{ "fields": [ { "declarator": "optionalOutputPath", "modifier": "private final", "original_string": "private final Optional<File> optionalOutputPath;", "type": "Optional<File>", "var_name": "optionalOutputPath" }, ...
{ "body": "@Override\n public Optional<SymbolEntry> getEntry(Symbol symbol) {\n search(symbol);\n if (namedSymbols.containsKey(symbol)) {\n return Optional.ofNullable(namedSymbols.get(symbol));\n } else {\n return symbol.accept(new SymbolVisitor<Optional<SymbolEntry>>() {...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_53
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformOperatorDefinitions() {\n transform(\n \"module scotch.test\",\n \"left infix 7 (*), (/), (%)\",\n \"left infix 6 (+), (-)\",\n \"prefix 9 `not`\"\n );\n shouldHaveOperator(\"scotch.test.(*)\", LEFT_INFIX...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_93
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/analyzer/TypeCheckerTest.java", "identifier": "TypeCheckerTest", "interfaces": "", "superclass": "extends IsolatedCompilerTest" }
{ "body": "@Test\n public void shouldBubbleUpMethodBindingWithPattern() {\n compile(\n \"module scotch.test\",\n \"import scotch.data.num\",\n \"fn a b = a + b\"\n );\n String num = \"scotch.data.num.Num\";\n Type t = t(12, asList(num));\n Instanc...
{ "fields": [ { "declarator": "mark = new Object()", "modifier": "private static final", "original_string": "private static final Object mark = new Object();", "type": "Object", "var_name": "mark" }, { "declarator": "graph", "modifier": "private final", "ori...
{ "body": "public Scope scope() {\n return scopes.peek();\n }", "class_method_signature": "TypeChecker.scope()", "constructor": false, "full_signature": "public Scope scope()", "identifier": "scope", "invocations": [ "peek" ], "modifiers": "public", "parameters": "()", "return": "Scope...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_85
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformGuardCase() {\n transform(\n \"module scotch.test\",\n \"fn x | True = 0\",\n \" | False = 1\"\n );\n shouldHavePattern(\"scotch.test.(#0)\", asList(capture(\"fn\", t(0)), capture(\"x\", t(1))), conditional(\n ...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_11
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldNotUnifyFunctionWithUnion() {\n Type function = fn(sum(\"String\"), sum(\"Int\"));\n Type union = sum(\"Int\");\n shouldBeMismatch(unify(function, union), function, union);\n }", "class_method_signature": "TypeTest.shouldNotUnifyFunctionWithUnion()", ...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_46
{ "fields": [ { "declarator": "resolver", "modifier": "private", "original_string": "private ClassLoaderResolver resolver;", "type": "ClassLoaderResolver", "var_name": "resolver" } ], "file": "scotch-compiler/src/test/java/scotch/compiler/ClassLoaderResolverTest.java", "ide...
{ "body": "@Test\n public void shouldResolveJavaTypeClass() {\n SymbolEntry entry = resolver.getEntry(symbol(\"scotch.data.num.Num\")).get();\n assertThat(entry.getTypeClass(), is(Optional.of(typeClass(\"scotch.data.num.Num\", asList(toType(var(\"a\"))), asList(\n \"scotch.data.num.(+)\",\...
{ "fields": [ { "declarator": "optionalOutputPath", "modifier": "private final", "original_string": "private final Optional<File> optionalOutputPath;", "type": "Optional<File>", "var_name": "optionalOutputPath" }, ...
{ "body": "@Override\n public Optional<SymbolEntry> getEntry(Symbol symbol) {\n search(symbol);\n if (namedSymbols.containsKey(symbol)) {\n return Optional.ofNullable(namedSymbols.get(symbol));\n } else {\n return symbol.accept(new SymbolVisitor<Optional<SymbolEntry>>() {...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_50
{ "fields": [ { "declarator": "resolver", "modifier": "private", "original_string": "private ClassLoaderResolver resolver;", "type": "ClassLoaderResolver", "var_name": "resolver" } ], "file": "scotch-compiler/src/test/java/scotch/compiler/ClassLoaderResolverTest.java", "ide...
{ "body": "@Test\n public void shouldResolveEqForListOfInt() {\n Set<TypeInstanceDescriptor> typeInstances = resolver.getTypeInstances(\n symbol(\"scotch.data.eq.Eq\"),\n asList(sum(\"scotch.data.list.[]\", asList(intType())).toDescriptor())\n );\n assertThat(typeInstance...
{ "fields": [ { "declarator": "optionalOutputPath", "modifier": "private final", "original_string": "private final Optional<File> optionalOutputPath;", "type": "Optional<File>", "var_name": "optionalOutputPath" }, ...
{ "body": "@Override\n public Set<TypeInstanceDescriptor> getTypeInstances(Symbol symbol, List<TypeDescriptor> types) {\n search(symbol);\n search(types);\n return Optional.ofNullable(typeInstances.get(symbol))\n .flatMap(instances -> instances.keySet().stream()\n .fi...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_70
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldParseMultipleDrawFromsInDoNotation() {\n transform(\n \"module scotch.test\",\n \"addedStuff = do\",\n \" x <- Just 3\",\n \" y <- Just 2\",\n \" return $ x + y\"\n );\n shouldHaveValue(\"scotc...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_7
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldPropagateFunctionIntoVariable() {\n Type target = fn(sum(\"Int\"), sum(\"String\"));\n Type variable = var(\"a\");\n shouldBeUnified(unify(target, variable), target);\n shouldBeBound(variable, target);\n }", "class_method_signature": "TypeTest.s...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_27
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file":...
{ "body": "@Test\n public void patternShouldAddDefaultCase() {\n // oneOrZero 1 = true\n // oneOrZero 0 = true\n Value pattern = matcher(\"scotch.test.oneOrZero\", t(1), arg(\"#0\", t(2)),\n pattern(\"scotch.test.(oneOrZero#0)\", asList(equal(arg(\"#0\", t(3)), literal(1))), literal...
{ "fields": [ { "declarator": "generator", "modifier": "private final", "original_string": "private final SymbolGenerator generator;", "type": "SymbolGenerator", "var_name": "generator" }, { "declarator": "patterns", "modifier": "private final", "origina...
{ "body": "private PatternState pattern() {\n return patterns.peek();\n }", "class_method_signature": "DefaultPatternReducer.pattern()", "constructor": false, "full_signature": "private PatternState pattern()", "identifier": "pattern", "invocations": [ "peek" ], "modifiers": "private", "...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_31
{ "fields": [ { "declarator": "resolver", "modifier": "@Mock\n private", "original_string": "@Mock\n private SymbolResolver resolver;", "type": "SymbolResolver", "var_name": "resolver" }, { "declarator": "symbolGenerator", "modifier": "@Mock\n private", ...
{ "body": "@Test(expected = IllegalStateException.class)\n public void shouldThrow_whenEnteringScopeWithoutModuleName() {\n rootScope.enterScope();\n }", "class_method_signature": "RootScopeTest.shouldThrow_whenEnteringScopeWithoutModuleName()", "constructor": false, "full_signature": "@Test(expect...
{ "fields": [ { "declarator": "symbolGenerator", "modifier": "private final", "original_string": "private final SymbolGenerator symbolGenerator;", "type": "SymbolGenerator", "var_name": "symbolGenerator" }, { "declarator": "resolver", "modifier": "private final...
{ "body": "@Override\n public Scope enterScope(String moduleName) {\n Scope scope = new ModuleScope(this, new DefaultTypeScope(symbolGenerator, resolver), resolver, symbolGenerator, moduleName);\n children.put(moduleName, scope);\n return scope;\n }", "class_method_signature": "RootScope....
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_89
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/parser/ModulesMapperTest.java", "identifier": "ModulesMapperTest", "interfaces": "", "superclass": "extends ScotchParserBaseTest" }
{ "body": "@Test\n public void shouldMapModules() {\n Map<String, List<ModuleContext>> map = new ModulesMapper().map(asList(\n parseTree(ScotchParser::modules,\n \"module a.b.c\",\n \"module x.y.z\",\n \"module a.b.c\"\n )\n ));\n ...
{ "fields": [], "file": "scotch-compiler/src/main/java/scotch/compiler/parser/ModulesMapper.java", "identifier": "ModulesMapper", "interfaces": "", "methods": [ { "class_method_signature": "ModulesMapper.map(List<? extends ParserRuleContext> ctx)", "constructor": false, "full_signature":...
{ "body": "public Map<String, List<ModuleContext>> map(List<? extends ParserRuleContext> ctx) {\n return new State().map(ctx);\n }", "class_method_signature": "ModulesMapper.map(List<? extends ParserRuleContext> ctx)", "constructor": false, "full_signature": "public Map<String, List<ModuleContext>> ma...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_66
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformInitializer() {\n transform(\n \"module scotch.test\",\n \"toast = Toast {\",\n \" type = Rye, butter = Yes, jam = No\",\n \"}\"\n );\n shouldHaveValue(\"scotch.test.toast\", initializer(t(1), id(\"Toa...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_88
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/parser/SymbolTransformerTest.java", "identifier": "SymbolTransformerTest", "interfaces": "", "superclass": "extends ScotchParserBaseTest" }
{ "body": "@Test(expected = TransformException.class)\n public void shouldThrow_whenTransformingOtherTree() {\n ParserRuleContext ctx = parseTree(ScotchParser::expression, \"(1, 2, 3)\");\n new SymbolTransformer().getSymbol(ctx);\n }", "class_method_signature": "SymbolTransformerTest.shouldThrow...
{ "fields": [], "file": "scotch-compiler/src/main/java/scotch/compiler/parser/SymbolTransformer.java", "identifier": "SymbolTransformer", "interfaces": "", "methods": [ { "class_method_signature": "SymbolTransformer.defaultResult()", "constructor": false, "full_signature": "@Override pub...
{ "body": "public Symbol getSymbol(ParserRuleContext ctx) {\n return ctx.accept(this)\n .orElseThrow(() -> new TransformException(\"Could not get symbol from \" + ctx.getClass().getSimpleName()));\n }", "class_method_signature": "SymbolTransformer.getSymbol(ParserRuleContext ctx)", "construct...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_67
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformDoNotationWithThen() {\n transform(\n \"module scotch.test\",\n \"messaged = do\",\n \" println \\\"Hello World!\\\"\",\n \" println \\\"Debilitating coffee addiction\\\"\"\n );\n shouldHaveValue(\"...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_30
{ "fields": [ { "declarator": "resolver", "modifier": "@Mock\n private", "original_string": "@Mock\n private SymbolResolver resolver;", "type": "SymbolResolver", "var_name": "resolver" }, { "declarator": "symbolGenerator", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void nothingShouldBeAnOperator() {\n assertThat(rootScope.isOperator_(qualified(\"scotch.module1\", \"fn\")), is(false));\n assertThat(rootScope.isOperator_(unqualified(\"fn\")), is(false));\n }", "class_method_signature": "RootScopeTest.nothingShouldBeAnOperator()", ...
{ "fields": [ { "declarator": "symbolGenerator", "modifier": "private final", "original_string": "private final SymbolGenerator symbolGenerator;", "type": "SymbolGenerator", "var_name": "symbolGenerator" }, { "declarator": "resolver", "modifier": "private final...
{ "body": "@Override\n public boolean isOperator_(Symbol symbol) {\n return symbol.accept(new SymbolVisitor<Boolean>() {\n @Override\n public Boolean visit(QualifiedSymbol symbol) {\n return children.containsKey(symbol.getModuleName()) && children.get(symbol.getModuleNam...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_26
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file":...
{ "body": "@Test\n public void shouldRaiseErrorWhenPatternHasNonTerminalDefaultCase() {\n // max a b = a\n // max a b = b\n exception.expect(PatternReductionException.class);\n exception.expect(is(new PatternReductionException(\"Non-terminal default pattern case\", NULL_SOURCE)));\n ...
{ "fields": [ { "declarator": "generator", "modifier": "private final", "original_string": "private final SymbolGenerator generator;", "type": "SymbolGenerator", "var_name": "generator" }, { "declarator": "patterns", "modifier": "private final", "origina...
{ "body": "private PatternState pattern() {\n return patterns.peek();\n }", "class_method_signature": "DefaultPatternReducer.pattern()", "constructor": false, "full_signature": "private PatternState pattern()", "identifier": "pattern", "invocations": [ "peek" ], "modifiers": "private", "...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_6
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldNotPropagateSumTypeIntoBoundVariableType() {\n Type target = sum(\"String\");\n Type variable = var(\"a\");\n Type binding = sum(\"Integer\");\n Unification actualStatus = binding.unify(variable, scope);\n shouldBeMismatch(unify(target, variab...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_71
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformTupleLiteral() {\n transform(\n \"module scotch.test\",\n \"tuple = (1, 2, 3)\"\n );\n shouldHaveValue(\"scotch.test.tuple\", initializer(t(0), id(\"scotch.data.tuple.(,,)\", t(1)), asList(\n field(\"_0\", unshuffle...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_51
{ "fields": [ { "declarator": "resolver", "modifier": "private", "original_string": "private ClassLoaderResolver resolver;", "type": "ClassLoaderResolver", "var_name": "resolver" } ], "file": "scotch-compiler/src/test/java/scotch/compiler/ClassLoaderResolverTest.java", "ide...
{ "body": "@Test\n public void shouldGetIntThroughScotchLang() {\n Optional<SymbolEntry> maybeEntry = resolver.getEntry(qualified(\"scotch.lang\", \"Int\"));\n assertThat(maybeEntry.map(SymbolEntry::getSymbol), is(Optional.of(qualified(\"scotch.data.int\", \"Int\"))));\n }", "class_method_signat...
{ "fields": [ { "declarator": "optionalOutputPath", "modifier": "private final", "original_string": "private final Optional<File> optionalOutputPath;", "type": "Optional<File>", "var_name": "optionalOutputPath" }, ...
{ "body": "@Override\n public Optional<SymbolEntry> getEntry(Symbol symbol) {\n search(symbol);\n if (namedSymbols.containsKey(symbol)) {\n return Optional.ofNullable(namedSymbols.get(symbol));\n } else {\n return symbol.accept(new SymbolVisitor<Optional<SymbolEntry>>() {...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_47
{ "fields": [ { "declarator": "resolver", "modifier": "private", "original_string": "private ClassLoaderResolver resolver;", "type": "ClassLoaderResolver", "var_name": "resolver" } ], "file": "scotch-compiler/src/test/java/scotch/compiler/ClassLoaderResolverTest.java", "ide...
{ "body": "@Test\n public void shouldResolveJavaTypeInstanceByClassAndType() {\n assertThat(resolver.getTypeInstances(symbol(\"scotch.data.num.Num\"), asList(intType().toDescriptor())), hasItem(typeInstance(\n \"scotch.data.num\",\n \"scotch.data.num.Num\",\n asList(intType(...
{ "fields": [ { "declarator": "optionalOutputPath", "modifier": "private final", "original_string": "private final Optional<File> optionalOutputPath;", "type": "Optional<File>", "var_name": "optionalOutputPath" }, ...
{ "body": "@Override\n public Set<TypeInstanceDescriptor> getTypeInstances(Symbol symbol, List<TypeDescriptor> types) {\n search(symbol);\n search(types);\n return Optional.ofNullable(typeInstances.get(symbol))\n .flatMap(instances -> instances.keySet().stream()\n .fi...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_10
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldReplaceChainsOfBoundVariables() {\n Type target = fn(var(\"a\"), sum(\"Int\"));\n Type query = fn(var(\"b\"), sum(\"Int\"));\n unify(target, query);\n unify(argumentOf(target), sum(\"String\"));\n shouldBeReplaced(target, fn(sum(\"String\"), s...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_84
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformLiteralPatternMatch() {\n transform(\n \"module scotch.test\",\n \"fib 0 = 0\"\n );\n shouldHavePattern(\"scotch.test.(#0)\", asList(capture(\"fib\", t(0)), equal(literal(0))), unshuffled(literal(0)));\n }", "class_method...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_92
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/analyzer/TypeCheckerTest.java", "identifier": "TypeCheckerTest", "interfaces": "", "superclass": "extends IsolatedCompilerTest" }
{ "body": "@Test\n public void shouldAnalyzeUnboundValue() {\n compile(\n \"module scotch.test\",\n \"import scotch.data.eq\",\n \"import scotch.data.num\",\n \"fn a b = a + b == b + a\",\n \"commutative? a b = fn a b\"\n );\n Type t = t(2...
{ "fields": [ { "declarator": "mark = new Object()", "modifier": "private static final", "original_string": "private static final Object mark = new Object();", "type": "Object", "var_name": "mark" }, { "declarator": "graph", "modifier": "private final", "ori...
{ "body": "public Scope scope() {\n return scopes.peek();\n }", "class_method_signature": "TypeChecker.scope()", "constructor": false, "full_signature": "public Scope scope()", "identifier": "scope", "invocations": [ "peek" ], "modifiers": "public", "parameters": "()", "return": "Scope...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_76
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformClassDefinition() {\n transform(\n \"module scotch.data.eq\",\n \"prefix 4 `not`\",\n \"left infix 5 (==), (/=)\",\n \"class Eq a where\",\n \" (==), (/=) :: a -> a -> Bool\",\n \" x == y = ...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_1
{ "fields": [], "file": "scotch-core/src/test/java/me/qmx/jitescript/JiteClassTest.java", "identifier": "JiteClassTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void generateClassWithSuperclasses() throws IllegalAccessException, InstantiationException {\n String className = \"Teste\";\n String superClass = p(LOL.class);\n JiteClass jiteClass = new JiteClass(className, superClass, new String[]{}) {{\n defineDefaultC...
{ "fields": [ { "declarator": "INTERFACES = new String[]{}", "modifier": "public static final", "original_string": "public static final String[] INTERFACES = new String[]{};", "type": "String[]", "var_name": "INTERFACES" }, { "declarator": "methods = new ArrayList<Metho...
{ "body": "public void defineDefaultConstructor() {\n defineDefaultConstructor(ACC_PUBLIC);\n }", "class_method_signature": "JiteClass.defineDefaultConstructor()", "constructor": false, "full_signature": "public void defineDefaultConstructor()", "identifier": "defineDefaultConstructor", "invocatio...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_21
{ "fields": [ { "declarator": "scope", "modifier": "private", "original_string": "private DefaultTypeScope scope;", "type": "DefaultTypeScope", "var_name": "scope" } ], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/ConstructorTypeTest.java", "identifier...
{ "body": "@Test\n public void shouldFlattenSubConstructors() {\n assertThat(fn(var(\"a\"), ctor(sum(\"List\"), var(\"a\"))).flatten(), is(fn(var(\"a\"), sum(\"List\", var(\"a\")))));\n }", "class_method_signature": "ConstructorTypeTest.shouldFlattenSubConstructors()", "constructor": false, "full_s...
{ "fields": [ { "declarator": "head", "modifier": "private final", "original_string": "private final Type head;", "type": "Type", "var_name": "head" }, { "declarator": "tail", "modifier": "private final", "original_string": "private final Type tail;", ...
{ "body": "@Override\n public Type flatten() {\n return head.flatten(tail.flatten_());\n }", "class_method_signature": "ConstructorType.flatten()", "constructor": false, "full_signature": "@Override public Type flatten()", "identifier": "flatten", "invocations": [ "flatten", "flatten_" ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_37
{ "fields": [ { "declarator": "exception = none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "parentScope", "m...
{ "body": "@Test\n public void shouldDelegateToParentWhenQualifyingSymbolThisIsNotDefinedLocally() {\n childScope.qualify(unqualified(\"fn\"));\n verify(parentScope).qualify(unqualified(\"fn\"));\n }", "class_method_signature": "ChildScopeTest.shouldDelegateToParentWhenQualifyingSymbolThisIsNotD...
{ "fields": [ { "declarator": "children", "modifier": "private final", "original_string": "private final Set<ChildScope> children;", "type": "Set<ChildScope>", "var_name": "children" }, { "declarator": "captures", "modifier": "private final", "original_strin...
{ "body": "@Override\n public Optional<Symbol> qualify(Symbol symbol) {\n return symbol.accept(new SymbolVisitor<Optional<Symbol>>() {\n @Override\n public Optional<Symbol> visit(QualifiedSymbol symbol) {\n if (moduleName.equals(symbol.getModuleName()) && entries.contain...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_60
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformPatternSignatureWithTypeContext() {\n transform(\n \"module scotch.test\",\n \"(==) :: Eq a => a -> a -> Bool\"\n );\n shouldHaveSignature(\"scotch.test.(==)\", fn(var(\"a\", asList(\"Eq\")), fn(var(\"a\", asList(\"Eq\")), sum...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_95
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/analyzer/TypeCheckerTest.java", "identifier": "TypeCheckerTest", "interfaces": "", "superclass": "extends IsolatedCompilerTest" }
{ "body": "@Test\n public void shouldBindMethodsInEqualMatch() {\n compile(\n \"module scotch.test\",\n \"import scotch.data.eq\",\n \"import scotch.data.int\",\n \"fib 0 = 0\"\n );\n InstanceType instance = instance(\"scotch.data.eq.Eq\", intType);\...
{ "fields": [ { "declarator": "mark = new Object()", "modifier": "private static final", "original_string": "private static final Object mark = new Object();", "type": "Object", "var_name": "mark" }, { "declarator": "graph", "modifier": "private final", "ori...
{ "body": "public Scope scope() {\n return scopes.peek();\n }", "class_method_signature": "TypeChecker.scope()", "constructor": false, "full_signature": "public Scope scope()", "identifier": "scope", "invocations": [ "peek" ], "modifiers": "public", "parameters": "()", "return": "Scope...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_83
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldDestructureToastWithTupleFieldMatch() {\n transform(\n \"module scotch.test\",\n \"data Person { name :: (String, String) }\",\n \"firstName Person { name = (fn, _) } = fn\"\n );\n shouldHavePattern(\"scotch.test.(#1)\",\n ...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_17
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldUnifySums() {\n SumType list1 = sum(\"List\", asList(toType(Int.TYPE)));\n SumType list2 = sum(\"List\", asList(toType(Int.TYPE)));\n shouldBeUnified(unify(list1, list2), sum(\"List\", asList(toType(Int.TYPE))));\n }", "class_method_signature": "TypeTe...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_40
{ "fields": [ { "declarator": "exception = none()", "modifier": "@Rule public final", "original_string": "@Rule public final ExpectedException exception = none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "resolver", "modifier": "@M...
{ "body": "@Test\n public void shouldThrow_whenEnteringScopeWithModuleName() {\n exception.expect(IllegalStateException.class);\n moduleScope.enterScope(\"module.name\");\n }", "class_method_signature": "ModuleScopeTest.shouldThrow_whenEnteringScopeWithModuleName()", "constructor": false, "f...
{ "fields": [ { "declarator": "importScopes", "modifier": "private final", "original_string": "private final List<ImportScope> importScopes;", "type": "List<ImportScope>", "var_name": "importScopes" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/scope/Modu...
{ "body": "@Override\n public Scope enterScope(List<Import> imports) {\n ImportScope scope = new ImportScope(this, new DefaultTypeScope(symbolGenerator, resolver), resolver, symbolGenerator, moduleName, ImmutableList.<Import>builder()\n .add(moduleImport(NULL_SOURCE, \"scotch.lang\"))\n ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_56
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformPatternSignatureWithTuple() {\n transform(\n \"module scotch.test\",\n \"second :: (a, b) -> b\"\n );\n shouldHaveSignature(\"scotch.test.second\", fn(sum(\"scotch.data.tuple.(,)\", asList(var(\"a\"), var(\"b\"))), var(\"b\"))...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_57
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformPatternSignatureWithList() {\n transform(\n \"module scotch.test\",\n \"head :: [a] -> a\"\n );\n shouldHaveSignature(\"scotch.test.head\", fn(sum(\"scotch.data.list.[]\", asList(var(\"a\"))), var(\"a\")));\n }", "class_m...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_41
{ "fields": [ { "declarator": "exception = none()", "modifier": "@Rule public final", "original_string": "@Rule public final ExpectedException exception = none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "resolver", "modifier": "@M...
{ "body": "@Test\n public void shouldGetNothingWhenQualifyingSymbolNotDefinedLocallyAndNotImported() {\n assertThat(moduleScope.qualify(unqualified(\"fn\")), is(Optional.empty()));\n }", "class_method_signature": "ModuleScopeTest.shouldGetNothingWhenQualifyingSymbolNotDefinedLocallyAndNotImported()", ...
{ "fields": [ { "declarator": "importScopes", "modifier": "private final", "original_string": "private final List<ImportScope> importScopes;", "type": "List<ImportScope>", "var_name": "importScopes" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/scope/Modu...
{ "body": "@Override\n public Optional<Symbol> qualify(Symbol symbol) {\n Optional<Symbol> optionalSymbol = importScopes.stream()\n .map(importScope -> importScope.qualify_(symbol))\n .filter(Optional::isPresent)\n .map(Optional::get)\n .findFirst();\n if (...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_16
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/TypeTest.java", "identifier": "TypeTest", "interfaces": "", "superclass": "extends UnificationTest" }
{ "body": "@Test\n public void shouldNotUnifyFunctionToTargetVariable_whenVariableHasContext() {\n VariableType target = var(\"a\", asList(\"Eq\"));\n Type function = fn(var(\"b\"), var(\"c\"));\n shouldBeContextMismatch(unify(target, function), target, function, asList(\"Eq\"), asList());\n ...
{ "fields": [ { "declarator": "NULL = new NullType()", "modifier": "public static final", "original_string": "public static final Type NULL = new NullType();", "type": "Type", "var_name": "NULL" } ], "file": "scotch-compiler/src/main/java/scotch/compiler/syntax/type/Type.java...
{ "body": "public Unification unify(Type type, TypeScope scope) {\n return generate(scope).unify_(type.generate(scope), scope);\n }", "class_method_signature": "Type.unify(Type type, TypeScope scope)", "constructor": false, "full_signature": "public Unification unify(Type type, TypeScope scope)", "i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_82
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldDestructureToastWithImplicitFieldCapture() {\n transform(\n \"module scotch.test\",\n \"data Toast { kind :: String, burnLevel :: Int }\",\n \"isBurned? Toast { burnLevel } = burnLevel > 3\"\n );\n shouldHavePattern(\"scotch...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_94
{ "fields": [], "file": "scotch-compiler/src/test/java/scotch/compiler/analyzer/TypeCheckerTest.java", "identifier": "TypeCheckerTest", "interfaces": "", "superclass": "extends IsolatedCompilerTest" }
{ "body": "@Test\n public void shouldBubbleUpMethodBindingWithFunction() {\n compile(\n \"module scotch.test\",\n \"import scotch.data.num\",\n \"fn = \\\\x y -> x + y\"\n );\n String num = \"scotch.data.num.Num\";\n Type t = t(11, asList(num));\n ...
{ "fields": [ { "declarator": "mark = new Object()", "modifier": "private static final", "original_string": "private static final Object mark = new Object();", "type": "Object", "var_name": "mark" }, { "declarator": "graph", "modifier": "private final", "ori...
{ "body": "public Scope scope() {\n return scopes.peek();\n }", "class_method_signature": "TypeChecker.scope()", "constructor": false, "full_signature": "public Scope scope()", "identifier": "scope", "invocations": [ "peek" ], "modifiers": "public", "parameters": "()", "return": "Scope...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_61
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformPatternSignatureWithMultipleTypeContexts() {\n transform(\n \"module scotch.test\",\n \"value :: (Eq a, Num a) => a\"\n );\n shouldHaveSignature(\"scotch.test.value\", var(\"a\", asList(\"Eq\", \"Num\")));\n }", "class_me...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_36
{ "fields": [ { "declarator": "exception = none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "parentScope", "m...
{ "body": "@Test\n public void leavingScopeShouldGiveParent() {\n assertThat(childScope.leaveScope(), sameInstance(parentScope));\n assertThat(childScope.enterScope().leaveScope(), sameInstance(childScope));\n }", "class_method_signature": "ChildScopeTest.leavingScopeShouldGiveParent()", "cons...
{ "fields": [ { "declarator": "children", "modifier": "private final", "original_string": "private final Set<ChildScope> children;", "type": "Set<ChildScope>", "var_name": "children" }, { "declarator": "captures", "modifier": "private final", "original_strin...
{ "body": "@Override\n public Scope enterScope() {\n ChildScope child = scope(this, types, resolver, symbolGenerator, moduleName);\n children.add(child);\n return child;\n }", "class_method_signature": "ChildScope.enterScope()", "constructor": false, "full_signature": "@Override publi...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_20
{ "fields": [ { "declarator": "scope", "modifier": "private", "original_string": "private DefaultTypeScope scope;", "type": "DefaultTypeScope", "var_name": "scope" } ], "file": "scotch-compiler/src/test/java/scotch/compiler/syntax/type/ConstructorTypeTest.java", "identifier...
{ "body": "@Test\n public void constructorWithVariableHeadShouldNotFlatten() {\n assertThat(ctor(var(\"m\"), var(\"a\")).flatten(), is(ctor(var(\"m\"), var(\"a\"))));\n }", "class_method_signature": "ConstructorTypeTest.constructorWithVariableHeadShouldNotFlatten()", "constructor": false, "full_sig...
{ "fields": [ { "declarator": "head", "modifier": "private final", "original_string": "private final Type head;", "type": "Type", "var_name": "head" }, { "declarator": "tail", "modifier": "private final", "original_string": "private final Type tail;", ...
{ "body": "@Override\n public Type flatten() {\n return head.flatten(tail.flatten_());\n }", "class_method_signature": "ConstructorType.flatten()", "constructor": false, "full_signature": "@Override public Type flatten()", "identifier": "flatten", "invocations": [ "flatten", "flatten_" ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_0
{ "fields": [], "file": "scotch-core/src/test/java/me/qmx/jitescript/JiteClassTest.java", "identifier": "JiteClassTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDSL() throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {\n final String className = \"helloTest\";\n JiteClass jiteClass = new JiteClass(className) {{\n // you can use the pre-constructor style\n ...
{ "fields": [ { "declarator": "INTERFACES = new String[]{}", "modifier": "public static final", "original_string": "public static final String[] INTERFACES = new String[]{};", "type": "String[]", "var_name": "INTERFACES" }, { "declarator": "methods = new ArrayList<Metho...
{ "body": "public void defineMethod(String methodName, int modifiers, String signature, CodeBlock methodBody) {\n this.methods.add(new MethodDefinition(methodName, modifiers, signature, methodBody));\n }", "class_method_signature": "JiteClass.defineMethod(String methodName, int modifiers, String signature...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
27292418_77
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "...
{ "body": "@Test\n public void shouldTransformUnaryDataDeclarationWithNamedFields() {\n transform(\n \"module scotch.test\",\n \"data Toast {\",\n \" type :: Bread,\",\n \" butter :: Bool,\",\n \" jam :: Bool\",\n \"}\"\n );\n...
{ "fields": [ { "declarator": "MAX_TUPLE_SIZE = 12", "modifier": "private static final", "original_string": "private static final int MAX_TUPLE_SIZE = 12;", "type": "int", "var_name": "MAX_TUPLE_SIZE" }, { "declarator": "definitions", "modifier": "private final", ...
{ "body": "public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) {\n definition(null, RootDefinition.builder(),\n builder -> moduleMap.keySet().forEach(\n moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName)))));\n retur...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 27292418, "size": 2664, "stargazer_count": 13, "stars": null, "updates": null, "url": "https://github.com/lmcgrath/scotch-lang" }
101436299_2
{ "fields": [], "file": "lambdora-common/src/test/java/org/fcrepo/lambdora/common/utils/UriUtilsTest.java", "identifier": "UriUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGrandchildOfRoot() {\n final URI uri = URI.create(INTERNAL_URI_PREFIX + \"/child/grandchild\");\n assertEquals(\"incorrect parent\", URI.create(INTERNAL_URI_PREFIX + \"/child\"), UriUtils.getParent(uri));\n }", "class_method_signature": "UriUtilsTest.testGrandc...
{ "fields": [ { "declarator": "ROOT = URI.create(INTERNAL_URI_PREFIX + \"/\")", "modifier": "private static final", "original_string": "private static final URI ROOT = URI.create(INTERNAL_URI_PREFIX + \"/\");", "type": "URI", "var_name": "ROOT" } ], "file": "lambdora-common/s...
{ "body": "public static URI getParent(final URI uri) {\n if (isRoot(uri)) {\n return null;\n } else {\n //get the parent path (with a slash on the end)\n final URI parent = uri.getPath().endsWith(\"/\") ? uri.resolve(\"..\") : uri.resolve(\".\");\n final Stri...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 101436299, "size": 198, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/duraspace/lambdora" }
101436299_0
{ "fields": [], "file": "lambdora-common/src/test/java/org/fcrepo/lambdora/common/utils/UriUtilsTest.java", "identifier": "UriUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test() {\n final URI root1 = URI.create(INTERNAL_URI_PREFIX + \"/\");\n assertNull(\"parent should be null\", UriUtils.getParent(root1));\n }", "class_method_signature": "UriUtilsTest.test()", "constructor": false, "full_signature": "@Test public void test()", ...
{ "fields": [ { "declarator": "ROOT = URI.create(INTERNAL_URI_PREFIX + \"/\")", "modifier": "private static final", "original_string": "private static final URI ROOT = URI.create(INTERNAL_URI_PREFIX + \"/\");", "type": "URI", "var_name": "ROOT" } ], "file": "lambdora-common/s...
{ "body": "public static URI getParent(final URI uri) {\n if (isRoot(uri)) {\n return null;\n } else {\n //get the parent path (with a slash on the end)\n final URI parent = uri.getPath().endsWith(\"/\") ? uri.resolve(\"..\") : uri.resolve(\".\");\n final Stri...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 101436299, "size": 198, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/duraspace/lambdora" }
101436299_1
{ "fields": [], "file": "lambdora-common/src/test/java/org/fcrepo/lambdora/common/utils/UriUtilsTest.java", "identifier": "UriUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testChildOfRoot() {\n final URI uri = URI.create(INTERNAL_URI_PREFIX + \"/test\");\n assertEquals(\"incorrect parent\", URI.create(INTERNAL_URI_PREFIX + \"/\"), UriUtils.getParent(uri));\n }", "class_method_signature": "UriUtilsTest.testChildOfRoot()", "construct...
{ "fields": [ { "declarator": "ROOT = URI.create(INTERNAL_URI_PREFIX + \"/\")", "modifier": "private static final", "original_string": "private static final URI ROOT = URI.create(INTERNAL_URI_PREFIX + \"/\");", "type": "URI", "var_name": "ROOT" } ], "file": "lambdora-common/s...
{ "body": "public static URI getParent(final URI uri) {\n if (isRoot(uri)) {\n return null;\n } else {\n //get the parent path (with a slash on the end)\n final URI parent = uri.getPath().endsWith(\"/\") ? uri.resolve(\"..\") : uri.resolve(\".\");\n final Stri...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 101436299, "size": 198, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/duraspace/lambdora" }
173572330_47
{ "fields": [ { "declarator": "activity", "modifier": "private", "original_string": "private ActivityController<Activity> activity;", "type": "ActivityController<Activity>", "var_name": "activity" }, { "declarator": "view", "modifier": "private", "original_s...
{ "body": "@Test\n public void testDecreasesDimensionsByViewPadding() {\n activity.visible();\n view.setLayoutParams(new FrameLayout.LayoutParams(100, 100));\n view.setPadding(25, 25, 25, 25);\n view.requestLayout();\n\n target.getSize(cb);\n\n verify(cb).onSizeReady(50, 50);\n }", "class_method...
{ "fields": [ { "declarator": "TAG = \"CustomViewTarget\"", "modifier": "private static final", "original_string": "private static final String TAG = \"CustomViewTarget\";", "type": "String", "var_name": "TAG" }, { "declarator": "VIEW_TAG_ID =\n R.id.glide_cu...
{ "body": "@Override\n public final void getSize(@NonNull SizeReadyCallback cb) {\n sizeDeterminer.getSize(cb);\n }", "class_method_signature": "CustomViewTarget.getSize(@NonNull SizeReadyCallback cb)", "constructor": false, "full_signature": "@Override public final void getSize(@NonNull SizeReadyC...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 173572330, "size": 26390, "stargazer_count": 45, "stars": null, "updates": null, "url": "https://github.com/0xZhangKe/Glide-note" }
173572330_10
{ "fields": [ { "declarator": "resource", "modifier": "@Mock private", "original_string": "@Mock private Resource<GifDrawable> resource;", "type": "Resource<GifDrawable>", "var_name": "resource" }, { "declarator": "decoder", "modifier": "@Mock private", "ori...
{ "body": "@Test\n public void testReturnsFalseIfAddingFrameFails() {\n when(decoder.getFrameCount()).thenReturn(1);\n when(decoder.getNextFrame()).thenReturn(Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888));\n\n when(gifEncoder.start(any(OutputStream.class))).thenReturn(true);\n when(gifEncoder.a...
{ "fields": [ { "declarator": "KEY_ENCODE_TRANSFORMATION =\n \"com.bumptech.glide.load.resource.gif.GifResourceEncoder.EncodeTransformation\"", "modifier": "private static final", "original_string": "private static final String KEY_ENCODE_TRANSFORMATION =\n \"com.bumptech.glide.load.re...
{ "body": "@Override\n public boolean encode(@NonNull Resource<GifDrawable> resource, @NonNull File file,\n @NonNull Options options) {\n GifDrawable drawable = resource.get();\n Transformation<Bitmap> transformation = drawable.getFrameTransformation();\n boolean isTransformed = !(transformation instan...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 173572330, "size": 26390, "stargazer_count": 45, "stars": null, "updates": null, "url": "https://github.com/0xZhangKe/Glide-note" }
173572330_51
{ "fields": [ { "declarator": "activity", "modifier": "private", "original_string": "private ActivityController<Activity> activity;", "type": "ActivityController<Activity>", "var_name": "activity" }, { "declarator": "view", "modifier": "private", "original_s...
{ "body": "@Test\n public void getSize_withValidWidthAndHeight_preV19_layoutRequested_callsSizeReady() {\n setSdkVersionInt(18);\n view.setLayoutParams(new FrameLayout.LayoutParams(100, 100));\n view.requestLayout();\n\n target.getSize(cb);\n\n verify(cb).onSizeReady(100, 100);\n }", "class_method_...
{ "fields": [ { "declarator": "TAG = \"CustomViewTarget\"", "modifier": "private static final", "original_string": "private static final String TAG = \"CustomViewTarget\";", "type": "String", "var_name": "TAG" }, { "declarator": "VIEW_TAG_ID =\n R.id.glide_cu...
{ "body": "@Override\n public final void getSize(@NonNull SizeReadyCallback cb) {\n sizeDeterminer.getSize(cb);\n }", "class_method_signature": "CustomViewTarget.getSize(@NonNull SizeReadyCallback cb)", "constructor": false, "full_signature": "@Override public final void getSize(@NonNull SizeReadyC...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 173572330, "size": 26390, "stargazer_count": 45, "stars": null, "updates": null, "url": "https://github.com/0xZhangKe/Glide-note" }
173572330_30
{ "fields": [ { "declarator": "activity", "modifier": "private", "original_string": "private ActivityController<Activity> activity;", "type": "ActivityController<Activity>", "var_name": "activity" }, { "declarator": "view", "modifier": "private", "original_s...
{ "body": "@Test\n public void testSizeCallbackIsCalledSynchronouslyIfLayoutParamsConcreteSizeSet() {\n int dimens = 444;\n LayoutParams layoutParams = new FrameLayout.LayoutParams(dimens, dimens);\n view.setLayoutParams(layoutParams);\n view.requestLayout();\n\n target.getSize(cb);\n\n verify(cb)....
{ "fields": [ { "declarator": "TAG = \"CustomViewTarget\"", "modifier": "private static final", "original_string": "private static final String TAG = \"CustomViewTarget\";", "type": "String", "var_name": "TAG" }, { "declarator": "VIEW_TAG_ID =\n R.id.glide_cu...
{ "body": "@Override\n public final void getSize(@NonNull SizeReadyCallback cb) {\n sizeDeterminer.getSize(cb);\n }", "class_method_signature": "CustomViewTarget.getSize(@NonNull SizeReadyCallback cb)", "constructor": false, "full_signature": "@Override public final void getSize(@NonNull SizeReadyC...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 173572330, "size": 26390, "stargazer_count": 45, "stars": null, "updates": null, "url": "https://github.com/0xZhangKe/Glide-note" }
173572330_7
{ "fields": [ { "declarator": "resource", "modifier": "@Mock private", "original_string": "@Mock private Resource<GifDrawable> resource;", "type": "Resource<GifDrawable>", "var_name": "resource" }, { "declarator": "decoder", "modifier": "@Mock private", "ori...
{ "body": "@Test\n public void testAdvancesDecoderBeforeAttemptingToGetFirstFrame() {\n when(gifEncoder.start(any(OutputStream.class))).thenReturn(true);\n when(decoder.getFrameCount()).thenReturn(1);\n when(decoder.getNextFrame()).thenReturn(Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888));\n\n e...
{ "fields": [ { "declarator": "KEY_ENCODE_TRANSFORMATION =\n \"com.bumptech.glide.load.resource.gif.GifResourceEncoder.EncodeTransformation\"", "modifier": "private static final", "original_string": "private static final String KEY_ENCODE_TRANSFORMATION =\n \"com.bumptech.glide.load.re...
{ "body": "@Override\n public boolean encode(@NonNull Resource<GifDrawable> resource, @NonNull File file,\n @NonNull Options options) {\n GifDrawable drawable = resource.get();\n Transformation<Bitmap> transformation = drawable.getFrameTransformation();\n boolean isTransformed = !(transformation instan...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 173572330, "size": 26390, "stargazer_count": 45, "stars": null, "updates": null, "url": "https://github.com/0xZhangKe/Glide-note" }