Skip to content

Commit

Permalink
codegen: remove obsolete code for non-local classes
Browse files Browse the repository at this point in the history
Implicit creating of classes in `this` was removed long ago
  • Loading branch information
VasiliyRyabtsev committed Oct 30, 2024
1 parent c94916f commit 11f7de6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
17 changes: 0 additions & 17 deletions squirrel/sqastcodegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,23 +673,6 @@ void CodegenVisitor::visitTableDecl(TableDecl *tableDecl) {
generateTableDecl(tableDecl);
}

void CodegenVisitor::checkClassKey(Expr *key) {
switch (key->op())
{
case TO_GETFIELD:
case TO_GETSLOT:
case TO_ROOT_TABLE_ACCESS:
return;
case TO_BASE:
case TO_ID:
reportDiagnostic(key, DiagnosticsId::DI_LOCAL_CLASS_SYNTAX);
break;
default:
reportDiagnostic(key, DiagnosticsId::DI_INVALID_CLASS_NAME);
break;
}
}

void CodegenVisitor::visitClassDecl(ClassDecl *klass) {
addLineNumber(klass);

Expand Down
2 changes: 0 additions & 2 deletions squirrel/sqastcodegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class CodegenVisitor : public Visitor {

void generateTableDecl(TableDecl *tableDecl);

void checkClassKey(Expr *key);

SQTable* GetScopedConstsTable();

void emitUnaryOp(SQOpcode op, UnExpr *arg);
Expand Down
2 changes: 0 additions & 2 deletions squirrel/sqcompilationcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ class KeyValueFile;
DEF_DIAGNOSTIC(INVALID_SLOT_INIT, ERROR, SEMA, -1, "", "Invalid slot initializer '%s' - no such variable/constant or incorrect expression"), \
DEF_DIAGNOSTIC(CANNOT_DELETE, ERROR, SEMA, -1, "", "can't delete %s"), \
DEF_DIAGNOSTIC(CONFLICTS_WITH, ERROR, SEMA, -1, "", "%s name '%s' conflicts with %s"), \
DEF_DIAGNOSTIC(LOCAL_CLASS_SYNTAX, ERROR, SEMA, -1, "", "cannot create a local class with the syntax (class <local>)"), \
DEF_DIAGNOSTIC(INVALID_CLASS_NAME, ERROR, SEMA, -1, "", "invalid class name or context"), \
DEF_DIAGNOSTIC(INC_DEC_NOT_ASSIGNABLE, ERROR, SEMA, -1, "", "argument of inc/dec operation is not assignable"), \
DEF_DIAGNOSTIC(SPACE_SEP_FIELD_NAME, ERROR, SEMA, -1, "", "Separate access operator '%s' with it's following name is forbidden"), \
DEF_DIAGNOSTIC(TOO_MANY_SYMBOLS, ERROR, SEMA, -1, "", "internal compiler error: too many %s"), \
Expand Down

0 comments on commit 11f7de6

Please sign in to comment.