Just move all the one-liner functions straight into the parser.

This commit is contained in:
Zed A. Shaw 2025-02-15 12:21:04 -05:00
parent 60ed686eb0
commit d558da1620
4 changed files with 38 additions and 76 deletions

View file

@ -10,16 +10,20 @@ namespace lel {
action token {tk = input.substr(start - begin, fpc - start); }
action col { col(); }
action ltab { ltab(); }
action valign { valign(fc); }
action col { }
action ltab { cur.row = rows; }
action valign { cur.bottom = fc == '.'; }
action id { id(input.substr(start - begin, fpc - start)); }
action row { row(); }
action align { align(fc); }
action setwidth { setwidth(std::stoi(tk)); }
action setheight { setheight(std::stoi(tk)); }
action expand { expand(); }
action center { center(); }
action row {
rows++;
columns = std::max(columns, cur.col);
cur.col = 0;
}
action align { cur.right = fc == '>'; }
action setwidth {cur.max_w = std::stoi(tk); }
action setheight { cur.max_h = std::stoi(tk); }
action expand { cur.expand = true; }
action center { cur.center = true; }
col = "|" $col;
ltab = "[" $ltab;