1 /*
2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2015 - Scilab Enterprises - Calixte DENIZET
4 *
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 *
7 * This file is hereby licensed under the terms of the GNU GPL v2.0,
8 * pursuant to article 5.3.4 of the CeCILL v.2.1.
9 * This file was originally licensed under the terms of the CeCILL v2.1,
10 * and continues to be available under such terms.
11 * For more information, see the COPYING file which you should have received
12 * along with this program.
13 *
14 */
15
16 #include "checkers/OldNotChecker.hxx"
17
18 namespace slint
19 {
20
preCheckNode(const ast::Exp & e,SLintContext & context,SLintResult & result)21 void OldNotChecker::preCheckNode(const ast::Exp & e, SLintContext & context, SLintResult & result)
22 {
23 const ast::NotExp & ne = static_cast<const ast::NotExp &>(e);
24 std::pair<unsigned int, unsigned int> pos;
25 if (context.getPosition(ne.getLocation(), pos))
26 {
27 if (pos.first < pos.second && *(context.getCode() + pos.first) == '@')
28 {
29 result.report(context, e.getLocation(), *this, _("Not operator \'~\' should be used rather than \'@\'."));
30 }
31 }
32 }
33
postCheckNode(const ast::Exp & e,SLintContext & context,SLintResult & result)34 void OldNotChecker::postCheckNode(const ast::Exp & e, SLintContext & context, SLintResult & result)
35 {
36 }
37
getName() const38 const std::string OldNotChecker::getName() const
39 {
40 return "OldNotChecker";
41 }
42 }
43