diff options
author | Jin Kyu Song <jin.kyu.song@intel.com> | 2013-08-21 19:29:08 -0700 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2013-08-22 19:37:25 +0400 |
commit | a800aed7b75d56114f2e1e4928cbc48ecf96a4a0 (patch) | |
tree | d695e29cb7edf686b01ebb3192edc845f3857fbc | |
parent | cc1dc9de53137e864bde06573556723149239f29 (diff) | |
download | nasm-a800aed7b75d56114f2e1e4928cbc48ecf96a4a0.tar.gz nasm-a800aed7b75d56114f2e1e4928cbc48ecf96a4a0.tar.bz2 nasm-a800aed7b75d56114f2e1e4928cbc48ecf96a4a0.zip |
AVX-512: Handle curly braces in multi-line macro parameters
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>
-rw-r--r-- | preproc.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -208,6 +208,7 @@ enum pp_token_type { TOK_PREPROC_Q, TOK_PREPROC_QQ, TOK_PASTE, /* %+ */ TOK_INDIRECT, /* %[...] */ + TOK_BRACE, /* \{...\} */ TOK_SMAC_PARAM, /* MUST BE LAST IN THE LIST!!! */ TOK_MAX = INT_MAX /* Keep compiler from reducing the range */ }; @@ -1103,6 +1104,10 @@ static Token *tokenize(char *line) type = TOK_COMMENT; while (*p) p++; + } else if (p[0] == '\\' && (p[1] == '{' || p[1] == '}')) { + type = TOK_BRACE; + p += 2; + line++; } else { /* * Anything else is an operator of some kind. We check |