We're close to being able to turn on the formatter as part of CI and part of the Jakt workflow. There are a few remaining issues we should fix before we do that. I'm making a list with checkboxes. If someone wants to work on one, comment below and we can put your name in. Once finished, we'll check it off the list:
1) If you miss the dot in the method call instead of a function, you get “wrong number of args” should say add dot
2) Move )
to newline:
let main_result = interpreter.execute(
function_to_run_id: main_function_id!
namespace_
this_argument: None
arguments
call_span)
Similar/same:
function is_return_allowed(
anon allowed_control_exits: AllowedControlExits) -> bool => not allowed_control_exits is Nothing
println(
"{{\"start\": {}, \"end\": {}, \"file\": \"{}\"}}"
result.start
result.end
escape_for_quotes(file_path!.path)
);
function main() {
for (_, function_id) in scope.functions.iterator() {
if function_.linkage is External or function_.type is ImplicitConstructor or function_.type is ImplicitEnumConstructor { continue }
output += .codegen_function(function_)
output += "\n"
}
}
if not (
type_module.is_root or type_module.id.equals(ModuleId(id: 0)) or checked_struct.definition_linkage is External
) {
output += type_module.name
output += "::"
}
Related:
yield match .execute(
call.function_id!
namespace_: Some(call.namespace_)
this_argument
arguments
call_span: span
invocation_scope: InterpreterScope::create(
type_bindings
)
) {
Return(value) => StatementResult::JustValue(value)
Throw(value) => StatementResult::Throw(value)
}
else => (.index as! i64+offset-1) as! usize
Also bad space:
let value = .input[.index]-offset
let number: f64 = u64_to_float<f64>(
total
) + u64_to_float<f64>(fraction_nominator) / u64_to_float<f64>(fraction_denominator)
guard lhs_variant_names.size(
) == rhs_variant_names.size() and lhs_variant_arguments.size() == rhs_variant_arguments.size() else {
return .name == rhs_parsed_varible.name and
.parsed_type.equals(rhs_parsed_varible.parsed_type) and
.is_mutable == rhs_parsed_varible.is_mutable
.error("Expected 'c' or path after `import extern`"
.current().span())
mut this, partial_enum: ParsedRecord, definition_linkage: DefinitionLinkage, is_boxed: bool) throws -> ([SumEnumVariant], [ParsedMethod]) {
.error(
format(
"Enum variant '{}' in enum '{}' has a non-constant value: {}"
variant.name
enum_.name
value_expression
)
variant.span
)
LessThan => { open_angles += 1}
Typed(name, span: variant_span) => {
if variant_span.contains(span) {
return Some(
Usage::EnumVariant(
span: variant_span
name
type_id: checked_enum.type_id
variants: enum_variant_fields(program, checked_enum_variant: variant)
number_constant: None
))
}
}
yield {format("else ({})", program.type_name(type_id))}
CInt(
x
) => CheckedExpression::NumericConstant(
val: CheckedNumericConstant::I32(x as! i32)
span: this_value.span
type_id: builtin(BuiltinType::CInt)
)
Should be:
CInt(x) =>
CheckedExpression::NumericConstant(
val: CheckedNumericConstant::I32(x as! i32)
span: this_value.span
type_id: builtin(BuiltinType::CInt)
)
bindings: [String:Value] = [:]
.error(
format(
"Prelude function `File::read_all` expects a `File` as its this argument, but got {}"
this_argument!.impl
),
call_span
)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too