From: C. M. <pu...@38...> - 2018-12-03 20:27:11
|
Hi, In the commit https://repo.or.cz/nasm.git/commitdiff/a0743398543202cc4fee33921820e33a2b5a4c3d you changed isidstart to not allow the question mark '?' in identifiers any longer. I understand that this is related to https://repo.or.cz/nasm.git/commitdiff/099cc177398df447ee7153ab29337f00dbcc9d16 which adds the ternary ? : operator. However, in my collection of macros (at https://bitbucket.org/ecm/lmacros -- look for lmacros2.mac's lframe, lvar, lpar, lenter, lleave) I'm using the question mark in identifiers for stack frame labels, primarily to distinguish the labels from any other kinds of labels. But also because I need to prefix or suffix the labels with something to avoid existing labels interfering with %define or %undef operation. (Ie, %undef %1 will first expand %1 to the first macro parameter, and if that is the name of an existing define, it will expand that define too. So %undef gets the contents of the define, not the define name. %undef ?%1 expands the %1 but doesn't expand the define.) A few observations: * When using ? in the ternary operator, there must be a valid expression term in front of it. And there must not be any unary or binary operators there (like - and +), because these imply that the ? is the start of an expression term itself (not the first part of the ternary operator). * In my use case, there is never whitespace after the ?. (However, it may be convenient when porting to "%define ? 0" for "db ?" cases.) * In my use case, there is never a colon in the expression tail after the question mark. Ideally, I'd like if you could either default to or add either a switch / several switches (or pragmas, or whatever) to either use a heuristic, or always treat question marks as parts of identifiers. (The latter case might disallow using the ternary operator, which if so tips this in favor of some heuristic.) Regards, ecm |