104 Commits

Author SHA1 Message Date
Southclaws
a47bd9de76
Merge pull request #240 from Daniel-Cortez/ht-patch
New hashtable implementation
2018-01-07 12:45:40 +00:00
Zeex
76507598f8 Refactor #warning and #pragma deprecated 2018-01-07 12:14:58 +06:00
Daniel_Cortez
d514b99760 Fix a type conversion warning 2018-01-07 04:21:13 +07:00
Daniel_Cortez
8b3583e7b5 Replace the hashmap implementation with a hashtable by Mattias Gustavsson 2018-01-07 02:35:08 +07:00
Zeex
c325ca3e02 Implement more straightforward line continuation ('\\') behavior
* Allow line continuation in single line comments

  Other languages allow this:

  // this is totally a single \
  line comment

  For example C++, at least GCC, Visual C++. I don't see why it
  should be forbidden.

* Don't insert \a symbols to mark

  Because we now don't need to check if there are '\\' in comments
  we no longer have to mark their positions with '\a' symbols.

* Don't trim leading space after '\\'

  Again, this is how other languages do it and it seems to be more
  intuitive. If you don't want spaces just don't indent your lines.

  new s[] = "see \
  this?"
2018-01-04 17:38:13 +06:00
Yashas
9a49ac51b2
stop removing '\a (internal multi-line delimiter)
This reverts a part of 693591bdc3 which caused issues as described in #226.
2018-01-03 18:09:54 +05:30
Zeex
4d1a3a99f7 Revert "Merge pull request #205 from VVWVV/concat_op"
This reverts commit 82dd745f90b9447ac2f196c31642660a7488453f, reversing
changes made to 2a930cedde954831eebee1a221a297e1019cb4df.
2017-12-31 18:27:58 +06:00
Zeex
11199da210 Fix compile warnings in pawnc 2017-12-30 16:12:33 +06:00
Zeex
82dd745f90
Merge pull request #205 from VVWVV/concat_op
Tokenisation operator
2017-12-30 15:15:28 +06:00
Zeex
064d35256b
Merge pull request #211 from Daniel-Cortez/emit_op_fixes
Fixes and improvements for emit/__emit
2017-12-30 15:00:52 +06:00
Daniel_Cortez
912376b658 emit/__emit: Check if the argument of instruction 'call' is a Pawn function 2017-11-17 20:03:50 +07:00
Daniel_Cortez
abe9c965dc emit/__emit: Make type mismatch errors more informative
Example:
    main()
    {
        new x;
        emit load.pri x
    }
Before this commit:
    error 017: undefined symbol "x"
After:
    error 001: expected token: "-data offset-", but found "-local variable-"
2017-11-17 20:03:50 +07:00
Daniel_Cortez
28c69cd8c8 #emit: Set the sign bit properly on non-32-bit cells 2017-11-12 19:44:51 +07:00
VVWVV
f59b285e17 fix ppconcat function 2017-11-04 00:05:54 +03:00
Y_Less
6060ce0ac8 Merge branch 'master' of github.com:Zeex/pawn 2017-10-28 14:40:58 +02:00
VVWVV
49f88fb49b fix incorrect comment 2017-10-28 03:20:12 +03:00
VVWVV
0786aed158 fix tokenisation operator in strings 2017-10-28 03:18:24 +03:00
Zeex
735291fd64 Merge branch 'performance' 2017-10-28 05:18:36 +06:00
Zeex
4a5e02ef29 Clean up global declarations 2017-10-28 05:05:37 +06:00
Y_Less
0e05780e8a Merge branch 'master' of github.com:Zeex/pawn 2017-10-26 17:08:11 +02:00
Y_Less
b7692fda79 #pragma option 2017-10-26 11:41:33 +02:00
Zeex
693591bdc3 Don't delete trailing whitespace before '\'
new s [] = "hello \
	world";

^ needs to be "hello world", not "helloworld".
2017-10-26 04:36:19 +06:00
VVWVV
a65f757a2c add tokenisation operator 2017-10-24 18:43:43 +03: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
Daniel_Cortez
dc21aec45d Set cache_sym->next to NULL in symbol_cache_remove() 2017-10-19 21:08:20 +02:00
Daniel_Cortez
03aaa4f2cd Minor adjustments 2017-10-19 21:08:20 +02:00
Daniel_Cortez
f5ba1b4077 Improved itoh() implementation 2017-10-19 21:08:20 +02:00
Daniel_Cortez
8665f8b03c Code cleanup, style fixes 2017-10-19 21:08:20 +02:00
Alex Martin
b312efa57b bug-fix: append new symbol to last one 2017-10-19 21:08:20 +02:00
Alex Martin
3c5f91dd0b fix symbol lookup for symbols with same name 2017-10-19 21:08:20 +02:00
Alex Martin
73d4934d61 store symbol children for faster lookup 2017-10-19 21:08:20 +02:00
Alex Martin
2d8791a0f2 minor improvement 2017-10-19 21:08:20 +02:00
Alex Martin
0138726698 add symbol lookup cache 2017-10-19 21:08:20 +02:00
Zeex
e7ecf386f8 Remove temporary '\a' characters and trailing whitespace in line continuations 2017-10-08 02:31:34 +06:00
Zeex
a0c994493d Merge pull request #192 from YashasSamaga/i187-fix
remove extra new lines from #warning and #pragma deprecated
2017-10-07 23:04:40 +06:00
Daniel_Cortez
6119df8f2b Rename asm to emit, add __emit as an alternate keyword. 2017-10-06 15:51:24 +07:00
Yashas
13314369a5 handle allocation failure in the previous commit 2017-09-30 09:33:47 +05:30
Yashas
bd133697fd remove extra new lines from #warning and #pragma deprecated
The `#warning` and `#pragma deprecated` directives print the new line characters which are part of the user entered string. As the message formats for both these already contain a new line character at the end, the aforementioned directives printed two new lines.

This commit adds code to discard the new line characters from user string.
2017-09-30 09:24:23 +05:30
VVWVV
fc9e3f785d Merge branch 'master' into feature_asm_expr 2017-08-01 22:36:34 +03:00
VVWVV
223838de79 Merge branch 'master' into fix_emit_crash 2017-07-29 22:21:31 +03:00
VVWVV
e0d5c1dc6a Update fix
Signed-off-by: VVWVV <d0u61ev@gmail.com>
2017-07-29 22:12:58 +03: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
VVWVV
284bbc1a12 Remove a variable for reference counting in emit
Signed-off-by: VVWVV <d0u61ev@gmail.com>
2017-03-12 10:33:59 +03:00
VVWVV
ba64ad437e Update the fix 2017-03-12 10:28:28 +03:00
VVWVV
6124e5e662 Add comments
Signed-off-by: VVWVV <d0u61ev@gmail.com>
2017-03-10 03:33:24 +03:00
Zeex
687d1ff017 Remove extra newlines from assembly listings
Those new lines were added in commit 6b2119f9. This is basically
an improved version of that fix.

Fixes #149.
2017-02-12 20:49:08 +06:00
Zeex
3a4878f54b Fix clang warnings 2017-02-11 19:32:10 +06:00
Zeex
8d6f051db4 Add __file, __date, __time constants
Closes #105, fixes #144.
2017-02-04 13:05:02 +06:00
Zeex
0cd10a73d6 Revert "Add built-in __file constant"
This reverts commit d15fc2224be20eac391062d1c1898b027a168713.
2017-02-03 00:45:21 +06:00
Zeex
d15fc2224b Add built-in __file constant
__file will be always set to the name of the currently processed input file.
It's similar to the __FILE__ macro in C.

See #105, #140.
2017-01-29 22:09:07 +06:00