titan-lang / titan

The Titan programming language
http://titan-lang.org
MIT License
406 stars 13 forks source link

Make generate_exp always return a single token #212

Closed hugomg closed 6 years ago

hugomg commented 6 years ago

That is, a variable name or constant literal.

Instead of compiling (a + b) + c to (a + b) + c) the coder will now output something like

tmp1 = a + b
tmp2 = tmp1 + c

This should make the order of evaluation wholly unambiguous and ensure that the output of generate_exp can be safely passed to macros or macro-like things (like our version of luaV_div and so on).

codecov-io commented 6 years ago

Codecov Report

Merging #212 into lablua will increase coverage by 1.89%. The diff coverage is 100%.

Impacted Files Coverage Δ
titan-compiler/coder.lua 93.82% <100%> (+4.61%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bbf6045...1065ab4. Read the comment docs.