summaryrefslogtreecommitdiff
path: root/nasm.h
diff options
context:
space:
mode:
authorJin Kyu Song <jin.kyu.song@intel.com>2013-11-27 14:10:40 -0800
committerJin Kyu Song <jin.kyu.song@intel.com>2013-11-27 15:43:33 -0800
commit487f352b6222c79fd6c719d2c00ab6087c6b6b3c (patch)
treed8b19e49b37c89586bba36691331f80111d71b79 /nasm.h
parent6cfa968e8d3ef6344ef3e92b37d64a277124ee29 (diff)
downloadnasm-487f352b6222c79fd6c719d2c00ab6087c6b6b3c.tar.gz
nasm-487f352b6222c79fd6c719d2c00ab6087c6b6b3c.tar.bz2
nasm-487f352b6222c79fd6c719d2c00ab6087c6b6b3c.zip
stdscan: Rework curly brace parsing routines
As recommended by the community, a comma-separated decorators ({k1,z}) and nested braces ({{k1},{z}}) are dropped out. So only standard syntax is supported from now. This rework made source code neat and easy to maintain. Most of the codes for handling corner cases are removed. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Diffstat (limited to 'nasm.h')
-rw-r--r--nasm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/nasm.h b/nasm.h
index cb786f8..87e82d2 100644
--- a/nasm.h
+++ b/nasm.h
@@ -65,6 +65,7 @@
#endif
#define IDLEN_MAX 4096
+#define DECOLEN_MAX 32
/*
* Name pollution problems: <time.h> on Digital UNIX pulls in some
@@ -421,6 +422,8 @@ extern struct preproc_ops preproc_nop;
* identifier. E.g. a period may only appear at the start of an identifier
* (for local labels), whereas a number may appear anywhere *but* at the
* start.
+ * isbrcchar matches any character that may placed inside curly braces as a
+ * decorator. E.g. {rn-sae}, {1to8}, {k1}{z}
*/
#define isidstart(c) (nasm_isalpha(c) || \
@@ -435,6 +438,9 @@ extern struct preproc_ops preproc_nop;
(c) == '#' || \
(c) == '~')
+#define isbrcchar(c) (isidchar(c) || \
+ (c) == '-')
+
/* Ditto for numeric constants. */
#define isnumstart(c) (nasm_isdigit(c) || (c) == '$')