Mercurial > emacs
diff lisp/cedet/semantic/lex.el @ 104419:b1ac14799f78
cedet/semantic/analyze.el, cedet/semantic/complete.el,
cedet/semantic/edit.el, cedet/semantic/html.el,
cedet/semantic/idle.el, cedet/semantic/texi.el: New files.
cedet/semantic/lex.el: Move defsubsts to front of file to avoid
compiler error.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 29 Aug 2009 19:00:35 +0000 |
parents | c13af98da4d6 |
children | df08b7ab0ba0 |
line wrap: on
line diff
--- a/lisp/cedet/semantic/lex.el Sat Aug 29 00:43:12 2009 +0000 +++ b/lisp/cedet/semantic/lex.el Sat Aug 29 19:00:35 2009 +0000 @@ -315,6 +315,42 @@ #'(lambda (symbol) (setq keywords (cons symbol keywords))) property) keywords)) + +;;; Inline functions: + +(defvar semantic-lex-unterminated-syntax-end-function) +(defvar semantic-lex-analysis-bounds) +(defvar semantic-lex-end-point) + +(defsubst semantic-lex-token-bounds (token) + "Fetch the start and end locations of the lexical token TOKEN. +Return a pair (START . END)." + (if (not (numberp (car (cdr token)))) + (cdr (cdr token)) + (cdr token))) + +(defsubst semantic-lex-token-start (token) + "Fetch the start position of the lexical token TOKEN. +See also the function `semantic-lex-token'." + (car (semantic-lex-token-bounds token))) + +(defsubst semantic-lex-token-end (token) + "Fetch the end position of the lexical token TOKEN. +See also the function `semantic-lex-token'." + (cdr (semantic-lex-token-bounds token))) + +(defsubst semantic-lex-unterminated-syntax-detected (syntax) + "Inside a lexical analyzer, use this when unterminated syntax was found. +Argument SYNTAX indicates the type of syntax that is unterminated. +The job of this function is to move (point) to a new logical location +so that analysis can continue, if possible." + (goto-char + (funcall semantic-lex-unterminated-syntax-end-function + syntax + (car semantic-lex-analysis-bounds) + (cdr semantic-lex-analysis-bounds) + )) + (setq semantic-lex-end-point (point))) ;;; Type table handling. ;; @@ -1012,23 +1048,6 @@ See also the function `semantic-lex-token'." (car token)) -(defsubst semantic-lex-token-bounds (token) - "Fetch the start and end locations of the lexical token TOKEN. -Return a pair (START . END)." - (if (not (numberp (car (cdr token)))) - (cdr (cdr token)) - (cdr token))) - -(defsubst semantic-lex-token-start (token) - "Fetch the start position of the lexical token TOKEN. -See also the function `semantic-lex-token'." - (car (semantic-lex-token-bounds token))) - -(defsubst semantic-lex-token-end (token) - "Fetch the end position of the lexical token TOKEN. -See also the function `semantic-lex-token'." - (cdr (semantic-lex-token-bounds token))) - (defsubst semantic-lex-token-text (token) "Fetch the text associated with the lexical token TOKEN. See also the function `semantic-lex-token'." @@ -1084,19 +1103,6 @@ ;; Created analyzers become variables with the code associated with them ;; as the symbol value. These analyzers are assembled into a lexer ;; to create new lexical analyzers. -;; -(defsubst semantic-lex-unterminated-syntax-detected (syntax) - "Inside a lexical analyzer, use this when unterminated syntax was found. -Argument SYNTAX indicates the type of syntax that is unterminated. -The job of this function is to move (point) to a new logical location -so that analysis can continue, if possible." - (goto-char - (funcall semantic-lex-unterminated-syntax-end-function - syntax - (car semantic-lex-analysis-bounds) - (cdr semantic-lex-analysis-bounds) - )) - (setq semantic-lex-end-point (point))) (defcustom semantic-lex-debug-analyzers nil "Non nil means to debug analyzers with syntax protection.