Age | Commit message (Collapse) | Author | Files | Lines |
|
Multi-line macro uses curly braces for enclosing a parameter
containing comma(s). Passing curly braces as a part of a parameter
which is already enclosed with braces confuses the macro expander.
The number of braces in a group parameter is counted and any brace
in the outmost enclosing braces is treated as a part of parameter.
e.g.) mmacro {1,2,3}, {4,{5,6}}
mmacro gets 2 parameters of '1,2,3' and '4,{5,6}'
Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
|
|
This reverts commit a800aed7b75d56114f2e1e4928cbc48ecf96a4a0.
As recommended by the community, braces inside a group parameter
of multi-line macro should be parsed without a need of a leading
escape character such as "\{ab,c\}".
Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
|
|
Giving a correct printf format specifier supresses the warning message.
And a local pointer variable is initialized with NULL.
Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
|
|
A typical example is
|
| %macro m0 0-*
| %rep %0
| m0 arg is %1
| %rotate 1
| %endrep
| %endmacro
|
| %macro m1 0-*
| m0 %{1:-1}
| %endmacro
|
| m1 a=b, c=d
If passed with nasm -E the output must be like
m0 arg is a=b
m0 arg is c=d
http://bugzilla.nasm.us/show_bug.cgi?id=3392270
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Multi-line macro uses curly braces for enclosing a parameter
containing comma(s). Passing curly braces as a part of a parameter
which is already enclosed with braces confuses the macro expander.
Escape character '\' is prefixed in this case.
e.g.) mmacro {1,2,3}, {4,\{5,6\}}
mmacro gets 2 parameters of '1,2,3' and '4,{5,6}'
Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Reported-by: franck.uberto@esrf.fr
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Bug found by: CppCheck 1.59 (static source analysis tool)
Signed-off-by: Philipp Kloke <philipp.kloke@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Reported-by: KO Myung-Hun <komh@chollian.net>
Tested-by: KO Myung-Hun <komh@chollian.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
In commit f1fe4fdeabeaf2e5e4d02ef43beeb09a6fbfed1b I occasionally
made a \Space after \BackSlash being a sign of line continuation.
Fix it.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
It's been reported that we handle MacOS eol wrong.
This patch fixes the problem.
http://bugzilla.nasm.us/show_bug.cgi?id=3392226
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
This should make it easier to read and moreover
now we're able to preprocess pasting as
%define N 1e%++%+ 5
dd N, 1e+5
Note that N should be expanded as series of pasting
to 1e+5 term, but before this patch we were ending
up in 1e+%+ 5 which is wrong.
In other words the fixed version output is
dd 1e+5, 1e+5
while broken one was
dd 1e+%+ 5, 1e+5
This patch also fixes nil dereferences in case if
there is no left or right token around pasting term.
http://bugzilla.nasm.us/show_bug.cgi?id=3392207
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
This will allow to hook on updated preprocessor
without breaking existing one.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
[backport 290eac75699fb768fdea4588772cf08b5db2788c]
2.09 series was the last one we support context-thru search
(and we were issuing a warning about that) so drop all-context
from get_ctx() routine.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Backport 99a055add917fe954038885d9013f8968f76790c
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
The NASM 2.09 preprocessor allows some illogical constructs, but which
unfortunately has been found in real code in the field. We need
a compatibility solution or a pragma before we can avoid that.
However, we need the other features in NASM 2.10 to come out, so
revert the preprocessor changes for now.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
In case if there a production
{tok},{%+},{whitespace}*
the preprocessor does not delete
ending paste+spaces tokens. Fix it.
http://bugzilla.nasm.us/show_bug.cgi?id=3392200
Reported-by: KO Myung-Hun <komh@chollian.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
It is a potential place for a bug if list_for_each
helper is used with multiple lines of code without
a proper bracing.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Otherwise naked %ifenv/%endif passes without a notice.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
In case if there a trailing spaces after expansion
%if[n]def might produce a false alarms on macro id
being expected.
Note it also makes the constructions like bare
%ifdef
%endif
invalid, while before they were passed well without
a notice.
Reported-by: KO Myung-Hun
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
For easier reading
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
new_ExpDef does zalloc'ate memory so no need
to assign zeros again.
Same time it should fix MSC complains on NULL assignment
on boolean variable.
Reported-by: Jasper Neuman <jasper.neumann@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
There is no need to hide this structure into a type.
The former preproc_ops is a way more descriptive.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
I belive this should simply code a bit.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Just for easier reading
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
2.09 series was the last one we support context-thru search
(and we were issuing a warning about that) so drop all-context
from get_ctx() routine.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
This reverts commit cb00cd1ba7f07f60f0a94c43cfc4fa7b01e2ff95.
As Victor pointed out some tests do not pass with this commit
so revert it until things get fixed.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
It's a bit more than that, also TRACE=1 make
flag added to run this facility on and off
at compiling time.
Debug feature only, doesn't affect regular users.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
We simply allow the following terminals to be concat'ed
if they are written without space or any other separator
inbetween.
a := id | preproc-id | number | float | other
b := id | preproc-id | number | float | other
if match(a,b):
s := concat(a,b)
re-tokenize(s)
Basically it means it's up to code author to write
preproc code a way the sane production appears.
Some notes.
1) We don't concat strings.
2) The 'weirdpaste' test fails now because with relaxed
rules it works as needed and was borken before.
The lacmus snippet is
%define N 1e%++%+ 5
dd N, 1e+5
Previously the output was
dd 1e+%+ 5, 1e+5
which is wrong since we have explicit concat here
with %+ operator. The new code production is correct
and looks like
dd 1e+5, 1e+5
as expected.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Conflicts:
doc/changes.src
version
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
src_set_fname simply gets copy of pointer (ideally
we need refcounting here) so don't pass the name
which will be freed soon but rather pass a copy.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
|
|
|
|
|