cjohansson / emacs-phps-mode

Emacs major mode for PHP with code intelligence
GNU General Public License v3.0
35 stars 2 forks source link

Caused endless loop in lexer #7

Closed zonuexe closed 5 years ago

zonuexe commented 5 years ago

I used develop branch of phps-mode (1f7331f51cbe0fdc35e5b4403a2ede910b2fc2e8) and Emacs 26.2 on macOS.

The following code will raise an error:

<?php

$k = 'key';

echo "\$a['{$k}']";

The following is output to the *Backtrace* buffer:

Debugger entered--Lisp error: (error "phps-mode-lexer-lex: endless loop at 31, after (T_ENCAPSED_AND_WHITESPACE 31 . 31)")
  signal(error ("phps-mode-lexer-lex: endless loop at 31, after (T_ENCAPSED_AND_WHITESPACE 31 . 31)"))
  error("phps-mode-lexer-lex: endless loop at %d, after %S" 31 (T_ENCAPSED_AND_WHITESPACE 31 . 31))
  (progn (error "phps-mode-lexer-lex: endless loop at %d, after %S" tmp-start (car semantic-lex-token-stream)))
  (if (eq semantic-lex-end-point tmp-start) (progn (error "phps-mode-lexer-lex: endless loop at %d, after %S" tmp-start (car semantic-lex-token-stream))))
  (while (and (< (point) end) (or (not length) (<= (length semantic-lex-token-stream) length))) (cond (t (let ((old-start (point)) (heredoc_label (car phps-mode-lexer-heredoc_label_stack)) (ST_IN_SCRIPTING (= phps-mode-lexer-STATE phps-mode-lexer-ST_IN_SCRIPTING)) (ST_INITIAL (= phps-mode-lexer-STATE phps-mode-lexer-ST_INITIAL)) (ST_LOOKING_FOR_PROPERTY (= phps-mode-lexer-STATE phps-mode-lexer-ST_LOOKING_FOR_PROPERTY)) (ST_DOUBLE_QUOTES (= phps-mode-lexer-STATE phps-mode-lexer-ST_DOUBLE_QUOTES)) (ST_BACKQUOTE (= phps-mode-lexer-STATE phps-mode-lexer-ST_BACKQUOTE)) (ST_HEREDOC (= phps-mode-lexer-STATE phps-mode-lexer-ST_HEREDOC)) (ST_NOWDOC (= phps-mode-lexer-STATE phps-mode-lexer-ST_NOWDOC)) (ST_LOOKING_FOR_VARNAME (= phps-mode-lexer-STATE phps-mode-lexer-ST_LOOKING_FOR_VARNAME)) (ST_END_HEREDOC (= phps-mode-lexer-STATE phps-mode-lexer-ST_END_HEREDOC)) (ST_VAR_OFFSET (= phps-mode-lexer-STATE phps-mode-lexer-ST_VAR_OFFSET))) (setq phps-mode-lexer-re2c-matching-body nil) (setq phps-mode-lexer-re2c-matching-length nil) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "exit")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "die")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "function")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "const")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "return")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at (concat "yield" phps-mode-lexer-WHITESPACE "from" "[^a-zA-Z0-9_\200-\377]"))) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "yield")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "try")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) 0 (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "catch")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "finally")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "throw")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "if")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "elseif")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "endif")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "else")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "while")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "endwhile")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "do")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "for")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "endfor")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "foreach")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "endforeach")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "declare")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "enddeclare")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "instanceof")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "as")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "switch")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "endswitch")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "case")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "default")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "break")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "continue")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "goto")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "echo")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "print")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "class")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "interface")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "trait")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "extends")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "implements")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "->")) (function (lambda nil (phps-mode-lexer-yy_push_state phps-mode-lexer-ST_LOOKING_FOR_PROPERTY) (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and (or ST_IN_SCRIPTING ST_LOOKING_FOR_PROPERTY) (looking-at phps-mode-lexer-WHITESPACE)) (function (lambda nil (let* ... ...)))) (phps-mode-lexer-re2c-rule (and ST_LOOKING_FOR_PROPERTY (looking-at "->")) (function (lambda nil (phps-mode-lexer-RETURN_TOKEN ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_LOOKING_FOR_PROPERTY (looking-at phps-mode-lexer-LABEL)) (function (lambda nil (let ... ... ...)))) (phps-mode-lexer-re2c-rule (and ST_LOOKING_FOR_PROPERTY (looking-at phps-mode-lexer-ANY_CHAR)) (function (lambda nil (let ... ... ...)))) ...)) (t (error "Unmatched Text during Lexical Analysis"))) (if (eq semantic-lex-end-point tmp-start) (progn (error "phps-mode-lexer-lex: endless loop at %d, after %S" tmp-start (car semantic-lex-token-stream)))) (setq tmp-start semantic-lex-end-point) (goto-char semantic-lex-end-point) (if (and semantic-current-input-throw-symbol (or (input-pending-p) (save-current-buffer (set-buffer (marker-buffer semantic--on-input-start-marker)) (save-excursion (goto-char semantic--on-input-start-marker) (accept-process-output))))) (progn (throw semantic-current-input-throw-symbol (quote lex)))) (semantic-lex-debug-break (car semantic-lex-token-stream)))
  (progn (set-syntax-table semantic-lex-syntax-table) (goto-char start) (while (and (< (point) end) (or (not length) (<= (length semantic-lex-token-stream) length))) (cond (t (let ((old-start (point)) (heredoc_label (car phps-mode-lexer-heredoc_label_stack)) (ST_IN_SCRIPTING (= phps-mode-lexer-STATE phps-mode-lexer-ST_IN_SCRIPTING)) (ST_INITIAL (= phps-mode-lexer-STATE phps-mode-lexer-ST_INITIAL)) (ST_LOOKING_FOR_PROPERTY (= phps-mode-lexer-STATE phps-mode-lexer-ST_LOOKING_FOR_PROPERTY)) (ST_DOUBLE_QUOTES (= phps-mode-lexer-STATE phps-mode-lexer-ST_DOUBLE_QUOTES)) (ST_BACKQUOTE (= phps-mode-lexer-STATE phps-mode-lexer-ST_BACKQUOTE)) (ST_HEREDOC (= phps-mode-lexer-STATE phps-mode-lexer-ST_HEREDOC)) (ST_NOWDOC (= phps-mode-lexer-STATE phps-mode-lexer-ST_NOWDOC)) (ST_LOOKING_FOR_VARNAME (= phps-mode-lexer-STATE phps-mode-lexer-ST_LOOKING_FOR_VARNAME)) (ST_END_HEREDOC (= phps-mode-lexer-STATE phps-mode-lexer-ST_END_HEREDOC)) (ST_VAR_OFFSET (= phps-mode-lexer-STATE phps-mode-lexer-ST_VAR_OFFSET))) (setq phps-mode-lexer-re2c-matching-body nil) (setq phps-mode-lexer-re2c-matching-length nil) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "exit")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "die")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "function")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "const")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "return")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at ...)) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "yield")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "try")) (function (lambda nil ...))) 0 (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "catch")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "finally")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "throw")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "if")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "elseif")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "endif")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "else")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "while")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "endwhile")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "do")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "for")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "endfor")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "foreach")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "endforeach")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "declare")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "enddeclare")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "instanceof")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "as")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "switch")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "endswitch")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "case")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "default")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "break")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "continue")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "goto")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "echo")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "print")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "class")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "interface")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "trait")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "extends")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "implements")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING (looking-at "->")) (function (lambda nil ... ...))) (phps-mode-lexer-re2c-rule (and (or ST_IN_SCRIPTING ST_LOOKING_FOR_PROPERTY) (looking-at phps-mode-lexer-WHITESPACE)) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_LOOKING_FOR_PROPERTY (looking-at "->")) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_LOOKING_FOR_PROPERTY (looking-at phps-mode-lexer-LABEL)) (function (lambda nil ...))) (phps-mode-lexer-re2c-rule (and ST_LOOKING_FOR_PROPERTY (looking-at phps-mode-lexer-ANY_CHAR)) (function (lambda nil ...))) ...)) (t (error "Unmatched Text during Lexical Analysis"))) (if (eq semantic-lex-end-point tmp-start) (progn (error "phps-mode-lexer-lex: endless loop at %d, after %S" tmp-start (car semantic-lex-token-stream)))) (setq tmp-start semantic-lex-end-point) (goto-char semantic-lex-end-point) (if (and semantic-current-input-throw-symbol (or (input-pending-p) (save-current-buffer (set-buffer (marker-buffer semantic--on-input-start-marker)) (save-excursion (goto-char semantic--on-input-start-marker) (accept-process-output))))) (progn (throw semantic-current-input-throw-symbol (quote lex)))) (semantic-lex-debug-break (car semantic-lex-token-stream))))
  (unwind-protect (progn (set-syntax-table semantic-lex-syntax-table) (goto-char start) (while (and (< (point) end) (or (not length) (<= (length semantic-lex-token-stream) length))) (cond (t (let ((old-start ...) (heredoc_label ...) (ST_IN_SCRIPTING ...) (ST_INITIAL ...) (ST_LOOKING_FOR_PROPERTY ...) (ST_DOUBLE_QUOTES ...) (ST_BACKQUOTE ...) (ST_HEREDOC ...) (ST_NOWDOC ...) (ST_LOOKING_FOR_VARNAME ...) (ST_END_HEREDOC ...) (ST_VAR_OFFSET ...)) (setq phps-mode-lexer-re2c-matching-body nil) (setq phps-mode-lexer-re2c-matching-length nil) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) 0 (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_IN_SCRIPTING ...) (function ...)) (phps-mode-lexer-re2c-rule (and ... ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_LOOKING_FOR_PROPERTY ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_LOOKING_FOR_PROPERTY ...) (function ...)) (phps-mode-lexer-re2c-rule (and ST_LOOKING_FOR_PROPERTY ...) (function ...)) ...)) (t (error "Unmatched Text during Lexical Analysis"))) (if (eq semantic-lex-end-point tmp-start) (progn (error "phps-mode-lexer-lex: endless loop at %d, after %S" tmp-start (car semantic-lex-token-stream)))) (setq tmp-start semantic-lex-end-point) (goto-char semantic-lex-end-point) (if (and semantic-current-input-throw-symbol (or (input-pending-p) (save-current-buffer (set-buffer ...) (save-excursion ... ...)))) (progn (throw semantic-current-input-throw-symbol (quote lex)))) (semantic-lex-debug-break (car semantic-lex-token-stream)))) (save-current-buffer (set-buffer buffer) (set-syntax-table table)))
  (let ((table (syntax-table)) (buffer (current-buffer))) (unwind-protect (progn (set-syntax-table semantic-lex-syntax-table) (goto-char start) (while (and (< (point) end) (or (not length) (<= (length semantic-lex-token-stream) length))) (cond (t (let (... ... ... ... ... ... ... ... ... ... ... ...) (setq phps-mode-lexer-re2c-matching-body nil) (setq phps-mode-lexer-re2c-matching-length nil) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) 0 (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) (phps-mode-lexer-re2c-rule ... ...) ...)) (t (error "Unmatched Text during Lexical Analysis"))) (if (eq semantic-lex-end-point tmp-start) (progn (error "phps-mode-lexer-lex: endless loop at %d, after %S" tmp-start (car semantic-lex-token-stream)))) (setq tmp-start semantic-lex-end-point) (goto-char semantic-lex-end-point) (if (and semantic-current-input-throw-symbol (or (input-pending-p) (save-current-buffer ... ...))) (progn (throw semantic-current-input-throw-symbol (quote lex)))) (semantic-lex-debug-break (car semantic-lex-token-stream)))) (save-current-buffer (set-buffer buffer) (set-syntax-table table))))
  (let* ((starting-position (point)) (semantic-lex-token-stream nil) (semantic-lex-block-stack nil) (tmp-start start) (semantic-lex-end-point start) (semantic-lex-current-depth 0) (semantic-lex-maximum-depth (or depth semantic-lex-depth)) (semantic-lex-analysis-bounds (cons start end)) (parse-sexp-lookup-properties nil)) (if (> end (point-max)) (progn (error "phps-mode-lexer-lex: end (%d) > point-max (%d)" end (point-max)))) (let ((table (syntax-table)) (buffer (current-buffer))) (unwind-protect (progn (set-syntax-table semantic-lex-syntax-table) (goto-char start) (while (and (< (point) end) (or (not length) (<= ... length))) (cond (t (let ... ... ... ... ... ... ... ... ... ... ... 0 ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)) (t (error "Unmatched Text during Lexical Analysis"))) (if (eq semantic-lex-end-point tmp-start) (progn (error "phps-mode-lexer-lex: endless loop at %d, after %S" tmp-start ...))) (setq tmp-start semantic-lex-end-point) (goto-char semantic-lex-end-point) (if (and semantic-current-input-throw-symbol (or ... ...)) (progn (throw semantic-current-input-throw-symbol ...))) (semantic-lex-debug-break (car semantic-lex-token-stream)))) (save-current-buffer (set-buffer buffer) (set-syntax-table table)))) (if semantic-lex-block-stack (progn (let* ((last (car-safe (prog1 semantic-lex-block-stack ...))) (blk last)) (while blk (message "phps-mode-lexer-lex: `%s' block from %S is unterminated" (car blk) (car (cdr blk))) (setq blk (car-safe (prog1 semantic-lex-block-stack ...)))) (semantic-lex-unterminated-syntax-detected (car last))))) (goto-char starting-position) (nreverse semantic-lex-token-stream))
  phps-mode-lexer-lex(1 41 nil nil)
  semantic-lex(1 41 nil)
  semantic-lex-buffer()
  (setq phps-mode-lexer-tokens (semantic-lex-buffer))
  phps-mode-lexer-run()
  (progn (if (and (> change-start 1) phps-mode-lexer-states) (progn (let ((state nil) (state-stack nil) (new-states (quote nil)) (states (nreverse phps-mode-lexer-states)) (previous-token-start nil) (previous-token-end nil) (tokens phps-mode-lexer-tokens)) (catch (quote stop-iteration) (let ((--dolist-tail-- states)) (while --dolist-tail-- (let ... ... ...)))) (if (and state state-stack) (let ((old-tokens ...)) (catch (quote stop-iteration) (let ... ...)) (setq old-tokens (nreverse old-tokens)) (let (...) (while --dolist-tail-- ...)) (let* (... ...) (setq phps-mode-lexer-tokens appended-tokens) (setq phps-mode-lexer-STATE state) (setq phps-mode-lexer-state_stack state-stack) (setq phps-mode-lexer-states new-states))))))) (phps-mode-lexer-run))
  (if change-start (progn (if (and (> change-start 1) phps-mode-lexer-states) (progn (let ((state nil) (state-stack nil) (new-states (quote nil)) (states (nreverse phps-mode-lexer-states)) (previous-token-start nil) (previous-token-end nil) (tokens phps-mode-lexer-tokens)) (catch (quote stop-iteration) (let (...) (while --dolist-tail-- ...))) (if (and state state-stack) (let (...) (catch ... ...) (setq old-tokens ...) (let ... ...) (let* ... ... ... ... ...)))))) (phps-mode-lexer-run)))
  (let ((change-start (phps-mode-functions-get-buffer-changes-start))) (if change-start (progn (if (and (> change-start 1) phps-mode-lexer-states) (progn (let ((state nil) (state-stack nil) (new-states ...) (states ...) (previous-token-start nil) (previous-token-end nil) (tokens phps-mode-lexer-tokens)) (catch (quote stop-iteration) (let ... ...)) (if (and state state-stack) (let ... ... ... ... ...))))) (phps-mode-lexer-run))))
  phps-mode-lexer-run-incremental()
  (progn (phps-mode-lexer-run-incremental) (setq phps-mode-functions-processed-buffer nil))
  (if (phps-mode-functions-get-buffer-changes-start) (progn (phps-mode-lexer-run-incremental) (setq phps-mode-functions-processed-buffer nil)))
  phps-mode-functions-process-current-buffer()
  phps-mode-functions-indent-line()
  indent-according-to-mode()
  electric-indent-post-self-insert-function()
  self-insert-command(1)
  #f(compiled-function (&optional arg interactive) "Insert a newline, and move to left margin of the new line if it's blank.\nIf option `use-hard-newlines' is non-nil, the newline is marked with the\ntext-property `hard'.\nWith ARG, insert that many newlines.\n\nIf `electric-indent-mode' is enabled, this indents the final new line\nthat it adds, and reindents the preceding line.  To just insert\na newline, use \\[electric-indent-just-newline].\n\nCalls `auto-fill-function' if the current column number is greater\nthan the value of `fill-column' and ARG is nil.\nA non-nil INTERACTIVE argument means to run the `post-self-insert-hook'." (interactive "*P\np") #<bytecode 0x400c1687>)(nil 1)
  apply(#f(compiled-function (&optional arg interactive) "Insert a newline, and move to left margin of the new line if it's blank.\nIf option `use-hard-newlines' is non-nil, the newline is marked with the\ntext-property `hard'.\nWith ARG, insert that many newlines.\n\nIf `electric-indent-mode' is enabled, this indents the final new line\nthat it adds, and reindents the preceding line.  To just insert\na newline, use \\[electric-indent-just-newline].\n\nCalls `auto-fill-function' if the current column number is greater\nthan the value of `fill-column' and ARG is nil.\nA non-nil INTERACTIVE argument means to run the `post-self-insert-hook'." (interactive "*P\np") #<bytecode 0x400c1687>) (nil 1))
  (if looking-at-whitespace (progn (setq phps-mode-functions-allow-after-change nil) (apply old-function arguments) (setq phps-mode-functions-allow-after-change t) (setq new-pos (point)) (let ((diff (- new-pos old-pos))) (if (> diff 0) (progn (phps-mode-lexer-move-tokens old-pos diff) (phps-mode-lexer-move-states old-pos diff) (phps-mode-functions-move-lines-indent old-line-number 1))))) (apply old-function arguments))
  (let ((old-pos (point)) (new-pos) (looking-at-whitespace (looking-at-p "[\n\011\015]*\n")) (old-line-number (line-number-at-pos))) (if looking-at-whitespace (progn (setq phps-mode-functions-allow-after-change nil) (apply old-function arguments) (setq phps-mode-functions-allow-after-change t) (setq new-pos (point)) (let ((diff (- new-pos old-pos))) (if (> diff 0) (progn (phps-mode-lexer-move-tokens old-pos diff) (phps-mode-lexer-move-states old-pos diff) (phps-mode-functions-move-lines-indent old-line-number 1))))) (apply old-function arguments)))
  (progn (let ((old-pos (point)) (new-pos) (looking-at-whitespace (looking-at-p "[\n\011\015]*\n")) (old-line-number (line-number-at-pos))) (if looking-at-whitespace (progn (setq phps-mode-functions-allow-after-change nil) (apply old-function arguments) (setq phps-mode-functions-allow-after-change t) (setq new-pos (point)) (let ((diff (- new-pos old-pos))) (if (> diff 0) (progn (phps-mode-lexer-move-tokens old-pos diff) (phps-mode-lexer-move-states old-pos diff) (phps-mode-functions-move-lines-indent old-line-number 1))))) (apply old-function arguments))))
  (if (string= major-mode "phps-mode") (progn (let ((old-pos (point)) (new-pos) (looking-at-whitespace (looking-at-p "[\n\011\015]*\n")) (old-line-number (line-number-at-pos))) (if looking-at-whitespace (progn (setq phps-mode-functions-allow-after-change nil) (apply old-function arguments) (setq phps-mode-functions-allow-after-change t) (setq new-pos (point)) (let ((diff ...)) (if (> diff 0) (progn ... ... ...)))) (apply old-function arguments)))) (apply old-function arguments))
  phps-mode-functions-around-newline(#f(compiled-function (&optional arg interactive) "Insert a newline, and move to left margin of the new line if it's blank.\nIf option `use-hard-newlines' is non-nil, the newline is marked with the\ntext-property `hard'.\nWith ARG, insert that many newlines.\n\nIf `electric-indent-mode' is enabled, this indents the final new line\nthat it adds, and reindents the preceding line.  To just insert\na newline, use \\[electric-indent-just-newline].\n\nCalls `auto-fill-function' if the current column number is greater\nthan the value of `fill-column' and ARG is nil.\nA non-nil INTERACTIVE argument means to run the `post-self-insert-hook'." (interactive "*P\np") #<bytecode 0x400c1687>) nil 1)
  apply(phps-mode-functions-around-newline #f(compiled-function (&optional arg interactive) "Insert a newline, and move to left margin of the new line if it's blank.\nIf option `use-hard-newlines' is non-nil, the newline is marked with the\ntext-property `hard'.\nWith ARG, insert that many newlines.\n\nIf `electric-indent-mode' is enabled, this indents the final new line\nthat it adds, and reindents the preceding line.  To just insert\na newline, use \\[electric-indent-just-newline].\n\nCalls `auto-fill-function' if the current column number is greater\nthan the value of `fill-column' and ARG is nil.\nA non-nil INTERACTIVE argument means to run the `post-self-insert-hook'." (interactive "*P\np") #<bytecode 0x400c1687>) (nil 1))
  newline(nil 1)
  funcall-interactively(newline nil 1)
  #<subr call-interactively>(newline nil nil)
  apply(#<subr call-interactively> newline (nil nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> newline nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (newline nil nil))
  call-interactively(newline nil nil)
  command-execute(newline)

Thanks.

cjohansson commented 5 years ago

Perfect, thanks for reporting, I have stumbled upon that error myself but not been able to reproduce it

cjohansson commented 5 years ago

This is now resolved in this commit

zonuexe commented 5 years ago

@cjohansson Crash was suppressed in my environment. Thank you!