chore: remove trailing whitespace from README.md line 42

This commit is contained in:
2025-12-07 21:57:06 +00:00
parent 36f84fba17
commit 170a3832ea
16 changed files with 1270 additions and 20 deletions
+35 -2
View File
@@ -331,6 +331,14 @@ static RavaType_t* _rava_semantic_check_expression(RavaSemanticAnalyzer_t *analy
for (size_t i = 0; i < expr->data.call.arguments_count; i++) {
_rava_semantic_check_expression(analyzer, expr->data.call.arguments[i]);
}
if (expr->data.call.callee->type == RAVA_AST_IDENTIFIER_EXPR) {
const char *func_name = expr->data.call.callee->data.identifier.name;
if (strcmp(func_name, "readLine") == 0) {
return rava_type_create_class("String");
} else if (strcmp(func_name, "sendResponse") == 0 || strcmp(func_name, "handleRequest") == 0) {
return rava_type_create_primitive(RAVA_TYPE_VOID);
}
}
if (expr->data.call.callee->type == RAVA_AST_MEMBER_ACCESS_EXPR) {
RavaASTNode_t *member = expr->data.call.callee;
const char *method = member->data.member_access.member;
@@ -385,13 +393,38 @@ static RavaType_t* _rava_semantic_check_expression(RavaSemanticAnalyzer_t *analy
if (strcmp(method, "getInetAddress") == 0 || strcmp(method, "getLocalAddress") == 0) {
return rava_type_create_class("InetAddress");
}
if (strcmp(method, "accept") == 0) {
return rava_type_create_class("Socket");
}
if (strcmp(method, "getInputStream") == 0) {
return rava_type_create_class("InputStream");
}
if (strcmp(method, "getOutputStream") == 0) {
return rava_type_create_class("OutputStream");
}
if (strcmp(method, "getSoTimeout") == 0 || strcmp(method, "getReceiveBufferSize") == 0 ||
strcmp(method, "getSendBufferSize") == 0) {
return rava_type_create_primitive(RAVA_TYPE_INT);
}
if (strcmp(method, "getTcpNoDelay") == 0 || strcmp(method, "getKeepAlive") == 0 ||
strcmp(method, "getReuseAddress") == 0 || strcmp(method, "isConnected") == 0 ||
strcmp(method, "isMulticastAddress") == 0 || strcmp(method, "isReachable") == 0) {
return rava_type_create_primitive(RAVA_TYPE_BOOLEAN);
}
if (strcmp(method, "read") == 0 || strcmp(method, "skip") == 0) {
return rava_type_create_primitive(RAVA_TYPE_INT);
}
if (strcmp(method, "length") == 0) {
return rava_type_create_primitive(RAVA_TYPE_INT);
} else if (strcmp(method, "charAt") == 0) {
return rava_type_create_primitive(RAVA_TYPE_CHAR);
} else if (strcmp(method, "equals") == 0) {
} else if (strcmp(method, "substring") == 0 || strcmp(method, "toLowerCase") == 0 ||
strcmp(method, "toUpperCase") == 0 || strcmp(method, "trim") == 0) {
return rava_type_create_class("String");
} else if (strcmp(method, "equals") == 0 || strcmp(method, "contains") == 0 ||
strcmp(method, "startsWith") == 0 || strcmp(method, "endsWith") == 0) {
return rava_type_create_primitive(RAVA_TYPE_BOOLEAN);
} else if (strcmp(method, "compareTo") == 0) {
} else if (strcmp(method, "compareTo") == 0 || strcmp(method, "indexOf") == 0) {
return rava_type_create_primitive(RAVA_TYPE_INT);
} else if (strcmp(method, "size") == 0) {
return rava_type_create_primitive(RAVA_TYPE_INT);