14 Commits

Author SHA1 Message Date
Daniel_Cortez
8b3583e7b5 Replace the hashmap implementation with a hashtable by Mattias Gustavsson 2018-01-07 02:35:08 +07:00
Daniel_Cortez
939c06011d emit/__emit: Another syntax change 2017-12-10 03:51:19 +07:00
Daniel_Cortez
907c4b610e emit/__emit: Syntax change 2017-11-29 21:52:05 +07:00
Zeex
4a5e02ef29 Clean up global declarations 2017-10-28 05:05:37 +06:00
Zeex
237d89e7e4 Merge branch 'performance' of https://github.com/maddinat0r/pawn into performance 2017-10-24 08:38:47 +06:00
Zeex
092b07464b Fix compile warning 2017-10-22 11:42:46 +06:00
Daniel_Cortez
aa9f589bf5 Memoize the address of the '__line' symbol instead of searching for it in loctab/glbtab every new line 2017-10-20 23:02:34 +07:00
Alex Martin
0138726698 add symbol lookup cache 2017-10-19 21:08:20 +02:00
Daniel_Cortez
6119df8f2b Rename asm to emit, add __emit as an alternate keyword. 2017-10-06 15:51:24 +07:00
VVWVV
e19354a52c Add new asm operator instead of #emit
Signed-off-by: VVWVV <d0u61ev@gmail.com>
2017-07-29 22:02:26 +03:00
Sergei Marochkin
1a608c25a1 Add -R param to enable or disable recursion report 2016-11-11 19:27:09 +03:00
Zeex
7ee5e98e30 Introduce compatibility mode
The compiler now has a new command-line option (-Z) that toggles
between normal mode and "compatibility" mode.

When this mode is on the compiler attempts to be compatible with
the current SA-MP compiler, which allows compiling old SA-MP scripts
that would not compile otherwise and at the same time benefiting
from new features and bug fixes.

In particular, this allows compiling code that relies on the auto
generated #include guard symbols (_inc_filename).

And in case you're wondering, the Z in "-Z" does not stand for "Zeex",
it just means "a letter that is unlikely to be ever taken by another
option".

This closes #23.
2014-03-29 21:31:53 +07:00
Zeex
53221dd2cc Introduce #pragma naked
When applied to a function #pragma naked merely disables the "should return
a value" warning for the function. It's intended to be used with functions
that return a value via #emit instead of the normal return statement.

This pragma works only on function definitions, not declarations. It's also
pretty stupid - the function may be defined way after this directive and it
won't stop on things coming in between.

For example, here all declarations between #pragma naked and f() are
effectively ignored:

#pragma naked

new x;       // ignored
forward g(); // ignored
native n();  // ignored

f() {
    // f() becomes naked
}

Note that #pragma naked does not affect generated code in any way, unlike
e.g. __declspec(naked) or __attribute__((naked)) in C/C++ where the compiler
omits the code for the prolog and epilog.
2014-01-05 01:26:10 +07:00
Zeex
766b96bcf3 Lower case directory names 2013-09-19 13:06:46 +07:00