mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-26 16:58:46 +00:00
function definition class structure changed, corresponding builders and printers fixes, fixes
This commit is contained in:
parent
18d7bdf5c1
commit
b4ce56b5f7
13 changed files with 323 additions and 284 deletions
|
|
@ -77,8 +77,7 @@ nodes::Literal build_string_literal(parser::ParseTree::Node parser_node) {
|
|||
std::string literal = parser_node.get_value();
|
||||
|
||||
// remove " from both sides ("string")
|
||||
literal.pop_back();
|
||||
literal = literal.substr(1, literal.size() - 1);
|
||||
literal = literal.substr(1, literal.size() - 2);
|
||||
|
||||
// replace escape sequences with escape characters
|
||||
bool is_escape_symbol = false;
|
||||
|
|
@ -111,9 +110,7 @@ nodes::Literal build_char_literal(parser::ParseTree::Node parser_node) {
|
|||
std::string literal = parser_node.get_value();
|
||||
|
||||
// remove '' from both sides (''x'')
|
||||
literal.pop_back();
|
||||
literal.pop_back();
|
||||
literal = literal.substr(1, literal.size() - 2);
|
||||
literal = literal.substr(2, literal.size() - 4);
|
||||
|
||||
char ch = '\0';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue