CheckOther::checkCharVariable: Refactoring using AST