aboutsummaryrefslogtreecommitdiffstats
path: root/asm/pptok.dat
Commit message (Collapse)AuthorAgeFilesLines
* preproc: fix %undef of macro aliases, and add %ifdefaliasH. Peter Anvin (Intel)2019-10-231-0/+1
| | | | | | | | | | | Macro aliases can legitimately point to nonexistent macros. Furthermore, %undef should remove the pointed-at macro, not the alias. This led to an infinite loop in the existing code; fix that. Add an %ifdefalias directive to test for the existence of an alias. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc: add %ifusable and %ifusing directivesH. Peter Anvin2019-09-121-0/+2
| | | | | | | | | %ifusable tests to see if a certain %use package is available in this version of NASM. %ifusing tests if a certain %use packages is already loaded. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc: standard macros now C-safe, %aliases off, fix %? recursionH. Peter Anvin2019-08-271-0/+1
| | | | | | | | | | | | | | | | | | | | Enough users expect the namespace starting with underscore to be safe for symbols. Change our private namespace from __foo__ to __?foo?__. Use %defalias to provide backwards compatiblity (by using %defalias instead of %define, we handle the case properly where the user changes the value.) Add a preprocessor directive: %aliases off ... to disable all smacro aliases and thereby making the namespace clean. Finally, fix infinite recursion when seeing %? or %?? due to paste_tokens(). If we don't paste anything, the expansion is done. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* preproc: simplify handling of conditionals and casesenseH. Peter Anvin (Intel)2019-08-151-28/+23
| | | | | | | | | | Simplify the handling of conditionals; remove the PPC_* types. Automate the generation of case-sensitive versus case-insensitive directives, and make it so the bulk of the code doesn't have to worry about it. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc: introduce alias smacros, cleanupsH. Peter Anvin (Intel)2019-08-141-0/+3
| | | | | | | | | | | | | | | | | | | | | Introduce "alias smacros", which are the smacro equivalent of symlinks; when used with the various smacro-defining and undefining directives, they affect the macro they are aliased to. Only explicit %defalias, %idefalias, and %undefalias affect them. This is intended for being able to rename macros while retaining the legacy names. This patch also removes an *astonishing* amount of duplicated code: 1. Every caller to defined_smacro() and undef_smacro() would call get_ctx() to mangle the macro name; push that into those functions. 2. Common code to get an smacro identifier. 3. Every code path that returns DIRECTIVE_FOUND also has to do free_tlist(origline); make it do so. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc: add %i... variants, evaluated macro parameters, cleanupsevalmacroH. Peter Anvin2019-02-261-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All directives which create single-line macros now have %i... variants to define case-insensitive versions. Case insensitive rather sucks, but at least this way it is consistent. Single-line macro parameters can now be evaluated as a number, as done by %assign. To do so, declare a parameter starting with =, for example: %define foo(x,=y) mov [x],macro_array_y ... would evaluate y as a number but leave x as a string. NOTE: it would arguably be better to have this as a per-instance basis, but it is easily handled by having a secondary macro called with the same argument twice. Finally, add a more consistent method for defining "magic" macros, which need to be evaluated at runtime. For now, it is only used by the special macros __FILE__, __LINE__, __BITS__, __PTR__, and __PASS__. __PTR__ is a new macro which evaluates to word, dword or qword matching the value of __BITS__. The magic macro framework, however, provides a natural hook for a future plug-in infrastructure to hook into a scripting language. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge remote-tracking branch 'origin/nasm-2.12.xx'H. Peter Anvin2016-10-041-1/+2
|
* Reorganize the source code into subdirectoriesH. Peter Anvin2016-05-251-0/+95
Make the source code easier to understand and keep track of by organizing it into subdirectories depending on the function. Signed-off-by: H. Peter Anvin <hpa@zytor.com>