1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00
This commit is contained in:
ton 2020-04-10 23:06:01 +04:00
parent 8be3fc99ed
commit be9c34c62d
699 changed files with 1171 additions and 978 deletions

View file

@ -23,7 +23,7 @@
exception statement from your version. If you delete this exception statement
from all source files in the program, then also delete it here.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "func.h"
#include "parser/srcread.h"

View file

@ -63,7 +63,7 @@ inline bool is_special_ident(sym_idx_t idx) {
*/
// TE ::= TA | TA -> TE
// TA ::= int | ... | cont | var | _ | () | ( TE { , TE } )
// TA ::= int | ... | cont | var | _ | () | ( TE { , TE } ) | [ TE { , TE } ]
TypeExpr* parse_type(Lexer& lex);
TypeExpr* parse_type1(Lexer& lex) {
@ -113,7 +113,7 @@ TypeExpr* parse_type1(Lexer& lex) {
return c == ')' ? TypeExpr::new_unit() : TypeExpr::new_tuple({});
}
auto t1 = parse_type(lex);
if (lex.tp() != ',') {
if (lex.tp() == ')') {
lex.expect(c);
return t1;
}
@ -346,7 +346,7 @@ Expr* parse_expr100(Lexer& lex, CodeBlob& code, bool nv) {
return res;
}
Expr* res = parse_expr(lex, code, nv);
if (lex.tp() != ',') {
if (lex.tp() == ')') {
lex.expect(clbr);
return res;
}

View file

@ -334,7 +334,7 @@ std::string UnifyError::message() const {
void check_width_compat(TypeExpr* te1, TypeExpr* te2) {
if (te1->minw > te2->maxw || te2->minw > te1->maxw) {
std::ostringstream os{"cannot unify types of widths "};
std::ostringstream os{"cannot unify types of widths ", std::ios_base::ate};
te1->show_width(os);
os << " and ";
te2->show_width(os);