X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/37007df185c3e3eae43c398ea2b01906ff99615c..527c590e8dcbddb0d04c0a1d7e530e5ef76acf6d:/packages/lex/lex.el diff --git a/packages/lex/lex.el b/packages/lex/lex.el index bd84f5800..6ba8123ed 100644 --- a/packages/lex/lex.el +++ b/packages/lex/lex.el @@ -1,6 +1,6 @@ ;;; lex.el --- Lexical analyser construction -*- lexical-binding:t -*- -;; Copyright (C) 2008,2013,2014 Free Software Foundation, Inc. +;; Copyright (C) 2008,2013,2014,2015 Free Software Foundation, Inc. ;; Author: Stefan Monnier ;; Keywords: @@ -918,7 +918,15 @@ Returns a new NFA." res)) +;;;###autoload (defun lex-compile (alist) + "Compile a set of regular expressions. +ALIST is a list of elements of the form (REGEXP . VALUE). +The compiled automaton will match all those regexps at the same time +and will return the VALUE fof the leftmost longest match. + +Each REGEXP object should be in the sexp form described in the +Commentary section." (lex--dfa-wrapper (lambda () (let* ((lex--char-equiv-table