During the instantiation of a generic type A, some other generic
type B may be instantiated multiple times with different parameters.
We can think about each instantiation as a function call that should
temporary bind the parameter names to concrete types. The problem
with the existing implementation in semtypinst was that it was
performing this binding within a shared global table. In this sense,
it was executing the code as a programming language featuring only
global variables. In such a language, re-entrant functions cannot be
defined properly and hence this was leading to problems with similar
types. The solution is simple - just like we need to introduce stack
frames to handle re-entrant functions, we introduce a stack of type
bindings that are pushed and popped during the generic instantiations.
* restrict casting for closure.
This commit forbid casting a closure to anything other than another
closure. use rawEnv/rawProc to access underlaying pointers.
* better error message for closure cast
* fixes#5742
* proper indentation for the generated JS code
* improved dead-code elimination for JavaScript
* test the JS dead-code elimination
A new test spec has been added - "maxcodesize". It specifies the
maximum size of the generated code in bytes.
* fix right shift c codegen bug.
signed int must first be cast as unsigned before converting to larger
integer. The C compiler will auto convert operands to the largest type.
* strVal assingnable comment statement ast nodes
* Set comment instead of strVal for comment nodes
* Added test code for creating and setting comment nodes
* Modified the AST spec documentation for documentation comments