1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Add constants and string literals to funC

* Add special string literals "..."? (s,a,u,h,)

* Add string literal H (256-bit hash)

* Add string literal c (crc32)

* Use td::hex_encode instead of homebrew function and add test

* Fix error codes and use more generic address

* Add support for int and slice constants

* Add support for strongly typed constants

* Add support for precompiled constant expressions (hard!)

Co-authored-by: starlightduck <starlightduck@gmail.com>
This commit is contained in:
EmelyanenkoK 2022-05-06 10:30:46 +03:00
parent 0e955793ed
commit 0c772185ef
14 changed files with 397 additions and 26 deletions

View file

@ -247,6 +247,11 @@ const Lexem& Lexer::next() {
}
lexem.set(std::string{src.get_ptr() + 1, end}, src.here(), qc == '`' ? Lexem::Unknown : Lexem::String);
src.set_ptr(end + 1);
c = src.cur_char();
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
lexem.val = c;
src.set_ptr(end + 2);
}
// std::cerr << lexem.name_str() << ' ' << lexem.str << std::endl;
return lexem;
}