Skip to content

Commit

Permalink
Remove other languages and use dataclass
Browse files Browse the repository at this point in the history
  • Loading branch information
niknetniko committed Nov 29, 2023
1 parent e056c3a commit f48fada
Show file tree
Hide file tree
Showing 34 changed files with 211 additions and 1,035 deletions.
10 changes: 0 additions & 10 deletions tested/dsl/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@
{
"required" : [
"oracle",
"language",
"file"
],
"properties" : {
Expand All @@ -360,10 +359,6 @@
"custom_check"
]
},
"language" : {
"type" : "string",
"description" : "The programming language of the custom check function."
},
"file" : {
"type" : "string",
"description" : "The path to the file containing the custom check function."
Expand Down Expand Up @@ -415,7 +410,6 @@
{
"required" : [
"oracle",
"language",
"file"
],
"properties" : {
Expand All @@ -425,10 +419,6 @@
"custom_check"
]
},
"language" : {
"type" : "string",
"description" : "The programming language of the custom check function."
},
"file" : {
"type" : "string",
"description" : "The path to the file containing the custom check function."
Expand Down
10 changes: 0 additions & 10 deletions tested/dsl/schema_draft7.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@
{
"required" : [
"oracle",
"language",
"file"
],
"properties" : {
Expand All @@ -355,10 +354,6 @@
"custom_check"
]
},
"language" : {
"type" : "string",
"description" : "The programming language of the custom check function."
},
"file" : {
"type" : "string",
"description" : "The path to the file containing the custom check function."
Expand Down Expand Up @@ -409,7 +404,6 @@
{
"required" : [
"oracle",
"language",
"file"
],
"properties" : {
Expand All @@ -419,10 +413,6 @@
"custom_check"
]
},
"language" : {
"type" : "string",
"description" : "The programming language of the custom check function."
},
"file" : {
"type" : "string",
"description" : "The path to the file containing the custom check function."
Expand Down
1 change: 0 additions & 1 deletion tested/dsl/translate_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ def _convert_custom_check_oracle(stream: dict) -> CustomCheckOracle:
assert isinstance(cv, Value)
converted_args.append(cv)
return CustomCheckOracle(
language=stream["language"],
function=EvaluationFunction(
file=stream["file"], name=stream.get("name", "evaluate")
),
Expand Down
266 changes: 0 additions & 266 deletions tested/judge/programmed.py

This file was deleted.

24 changes: 1 addition & 23 deletions tested/languages/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
conventionalize_namespace,
submission_name,
)
from tested.serialisation import FunctionCall, Statement, Value
from tested.serialisation import Statement, Value

if typing.TYPE_CHECKING:
from tested.configs import GlobalConfig
Expand Down Expand Up @@ -289,18 +289,6 @@ def modify_solution(self, solution: Path):
"""
pass

def modify_specific_evaluator(self, evaluator: Path):
"""
An opportunity to modify the language-specific oracle. By default,
this does nothing. If you modify the oracle, you must overwrite the
contents of the oracle in-place.
This callback is called before any compilation.
:param evaluator: Path to the oracle and path for the modified oracle.
"""
pass

def compiler_output(
self, stdout: str, stderr: str
) -> tuple[list[Message], list[AnnotateCode], str, str]:
Expand Down Expand Up @@ -443,16 +431,6 @@ def generate_selector(self, contexts: list[str]) -> str:
"""
raise NotImplementedError

def generate_check_function(self, name: str, function: FunctionCall) -> str:
"""
Generate code that calls the given function as a custom check function.
:param name: The name of the custom check function.
:param function: The function to call.
:return: A string representing the custom check function.
"""
raise NotImplementedError

@abstractmethod
def generate_encoder(self, values: list[Value]) -> str:
"""
Expand Down
Loading

0 comments on commit f48fada

Please sign in to comment.