Commit 8a337379 authored by Victor Yacovlev's avatar Victor Yacovlev

Fixed .e real parsing + error message order

parent 947d1160
...@@ -4146,6 +4146,10 @@ AST::Expression * SyntaxAnalizerPrivate::parseSimpleName(const std::list<Lexem * ...@@ -4146,6 +4146,10 @@ AST::Expression * SyntaxAnalizerPrivate::parseSimpleName(const std::list<Lexem *
result->constant = parseConstant(lexems, type, maxDim); result->constant = parseConstant(lexems, type, maxDim);
if (result->constant.type()==QVariant::Double) if (result->constant.type()==QVariant::Double)
result->baseType.kind = AST::TypeReal; result->baseType.kind = AST::TypeReal;
if (!result->constant.isValid()) {
delete result;
result = 0;
}
return result; return result;
} }
} }
......
...@@ -788,6 +788,11 @@ public: ...@@ -788,6 +788,11 @@ public:
return 0.0; return 0.0;
} }
if (sExponenta.length()>0 && sExponenta.find(Char('.'))!=String::npos) {
error = WrongExpForm;
return 0.0;
}
fraction = fromDecimal(sFractional.substr(0,fractionalLength)); fraction = fromDecimal(sFractional.substr(0,fractionalLength));
for (int i=0; i<fractionalLength; i++) { for (int i=0; i<fractionalLength; i++) {
fraction /= 10.0; fraction /= 10.0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment