Match either a keyword or an ordinary, simple identifier.
(vl-lex-simple-identifier-or-keyword echars table) → (mv token/nil remainder)
Function:
(defun vl-lex-simple-identifier-or-keyword (echars table) (declare (xargs :guard (and (vl-echarlist-p echars) (vl-keyword-table-p table)))) (let ((__function__ 'vl-lex-simple-identifier-or-keyword)) (declare (ignorable __function__)) (b* (((unless (and (consp echars) (vl-simple-id-head-echar-p (car echars)))) (mv nil echars)) ((mv prefix remainder) (vl-read-simple-identifier echars)) (str (hons-copy (vl-echarlist->string prefix))) (lookup (vl-keyword-lookup str table)) (token (if lookup (make-vl-plaintoken :etext prefix :type lookup) (make-vl-idtoken :etext prefix :name str)))) (mv token remainder))))