* lisp/progmodes/hideif.el: update for new C++ standards and extensions

Matching gcc/clang behavior on stringification including keeping the same
number of white spaces.  C++11, C++14, C++17 and GCC literals extension are
supported.  Preprocessing time floating point operation supported but limited
to Emacs internal representation which is C data type "double".  Also support
some frequently used keywords like __LINE__, __TIME__, __DATE__ and so on.

(hif-clear-all-ifdef-defined, hif-show-all, hif-after-revert-function)
(hide-ifdef-define, hide-ifdefs, show-ifdefs): interactive behavior changes,
mainly to allow operation within the marked region.
(hif-eval, hif-__LINE__, hif-__FILE__, hif-__COUNTER__, hif-__cplusplus)
(hif-__DATE__, hif-__TIME__, hif-__STDC__, hif-__STDC_VERSION__)
(hif-__STDC_HOST__, hif-__FILE__, hif-full-match, hif-is-number, hif-is-float)
(hif-delete-char-in-string, hif-string-to-decfloat, hif-string-to-hexfloat)
(hif-strtok, hif-is-white, hif-backward-comment, hif-split-signed-token)
(hif-keep-single, hif-display-macro): new functions.
(hide-ifdef-verbose, hide-ifdef-evalulate-enter-hook)
(hide-ifdef-evalulate-leave-hook, hide-ifdef-evaluator, hif-predefine-alist)
(hif-numtype-suffix-regexp, hif-bin-regexp, hif-hex-regexp, hif-oct-regexp)
(hif-dec-regexp, hif-decfloat-regexp, hif-hexfloat-regexp)
(hif-unicode-prefix-regexp, hif-verbose-define-count): new constants or
variables.
(hif-macroref-regexp, hif-token-alist, hif-token-regexp)
(hif-string-literal-regexp): modified constants for faster regexp processing.
(hide-ifdef-expand-reinclusion-guard): renamed from
`hide-ifdef-expand-reinclusion-protection' to match commonly used term.
(hif-lookup, hif-defined, hif-string-to-number, hif-tokenize, hif-nextoken)
(hif-if-valid-identifier-p, hif-define-operator, hif-expand-token-list)
(hif-parse-exp, hif-math, hif-factor, hif-get-argument-list, hif-stringify)
(hif-token-concat, hif-mathify, hif-comma, hif-token-stringification)
(hif-token-concatenation, hif-macro-supply-arguments, hif-evaluate-macro)
(hif-find-define, hif-add-new-defines, hide-ifdef-guts, hif-undefine-symbol)
(hide-ifdef-set-define-alist, hide-ifdef-use-define-alist): modified functions
for new internal data representation, mainly for stringification and white
space preservation.  Also better error handling to report source line number
and more informative error messages.
This commit is contained in:
Luke Lee 2021-06-02 20:29:00 +08:00
parent f064b23d09
commit 87e7390aae

File diff suppressed because it is too large Load diff