cimplec / sim-c

A dynamically typed high-level front end for C

Home Page:https://cimplec.github.io/docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG REPORT] Functions inside functions

Math-O5 opened this issue · comments

Describe the bug
Sim-C is wrongly allowing declarations of function inside function, but C does not accept it.

To Reproduce

Sim-C code:

fun joy( ) {
     
     // This function should not be allowed, stop this evil behavior
     fun evil ( ) {
     }

}

MAIN

  // This function should not be allowed here, stop this evil behavior
   fun evil_two( ) {
   }

END_MAIN

Output: C code!

Expected behavior
Throw a message error to user.

Please, follow the CONTRIBUTION.md instructions.