- match: '#[a-zA-Z_]+'
scope: keyword.other.onyx
+ - match: '([a-zA-Z_][a-zA-Z0-9_]*)\s*::\s*proc'
+ captures:
+ 1: entity.name.function
+
+ - match: '([a-zA-Z_][a-zA-Z0-9_]*)\s*::\s*struct'
+ captures:
+ 1: entity.name.struct
+
+ - match: '([a-zA-Z_][a-zA-Z0-9_]*)\s*::\s*enum'
+ captures:
+ 1: entity.name.enum
+
- match: '([a-zA-Z_][a-zA-Z0-9_\.]+)\s*\('
captures:
1: meta.function-call.onyx
if (types_are_compatible(node->type, type)) return 1;
if (node_is_auto_cast((AstNode *) node)) {
- // If the node is an auto cast, we convert it to a cast node which will reports errors if
- // the cast is illegal in the code generation.
+ // HACK: Check that this cast is legal!
((AstUnaryOp *) node)->type = type;
- // ((AstUnaryOp *) node)->operation = Unary_Op_Cast;
return 1;
}
else if (node->kind == Ast_Kind_NumLit) {
break;
}
+ case Unary_Op_Auto_Cast:
case Unary_Op_Cast: emit_cast(mod, &code, unop); break;
-
- // NOTE: Any remaining auto casts can be ignored since it means that a cast was not necessary. - brendanfh 2020/09/19
- case Unary_Op_Auto_Cast: emit_cast(mod, &code, unop); break;
}
*pcode = code;