Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smie error on simple syntax #222

Open
krux02 opened this issue Feb 20, 2019 · 0 comments
Open

smie error on simple syntax #222

krux02 opened this issue Feb 20, 2019 · 0 comments
Labels

Comments

@krux02
Copy link
Contributor

krux02 commented Feb 20, 2019

In the following example, where | is the cursor position, hitting enter causes an error

echo x.type|

this is the stack trace:

Debugger entered--Lisp error: (error "Bumped into unknown token")
  signal(error ("Bumped into unknown token"))
  error("Bumped into unknown token")
  smie-indent-backward-token()
  smie-indent-after-keyword()
  run-hook-with-args-until-success(smie-indent-after-keyword)
  smie-indent-calculate()
  smie-indent-virtual()
  smie-indent--rule(:after "type" 144 nil 139)
  smie-indent-after-keyword()
  run-hook-with-args-until-success(smie-indent-after-keyword)
  smie-indent-calculate()
  (or (smie-indent-calculate) 0)
  (save-excursion (forward-line 0) (skip-chars-forward " \011") (if (>= (point) savep) (setq savep nil)) (or (smie-indent-calculate) 0))
  (condition-case err (save-excursion (forward-line 0) (skip-chars-forward " \011") (if (>= (point) savep) (setq savep nil)) (or (smie-indent-calculate) 0)) ((debug error) (message "Error: %S" err) nil))
  (or (condition-case err (save-excursion (forward-line 0) (skip-chars-forward " \011") (if (>= (point) savep) (setq savep nil)) (or (smie-indent-calculate) 0)) ((debug error) (message "Error: %S" err) nil)) 0)
  (let* ((savep (point)) (indent (or (condition-case err (save-excursion (forward-line 0) (skip-chars-forward " \011") (if (>= (point) savep) (setq savep nil)) (or (smie-indent-calculate) 0)) ((debug error) (message "Error: %S" err) nil)) 0))) (cond ((eq 'noindent indent) nil) ((assoc-default :comment nim-smie--line-info) (nim-get-comment-indent)) ((or (not (numberp indent)) (< indent 0)) 0) (t (or (assoc-default :force-indent nim-smie--line-info) indent))))
  (if empty-line-indent empty-line-indent (let* ((savep (point)) (indent (or (condition-case err (save-excursion (forward-line 0) (skip-chars-forward " \011") (if (>= (point) savep) (setq savep nil)) (or (smie-indent-calculate) 0)) ((debug error) (message "Error: %S" err) nil)) 0))) (cond ((eq 'noindent indent) nil) ((assoc-default :comment nim-smie--line-info) (nim-get-comment-indent)) ((or (not (numberp indent)) (< indent 0)) 0) (t (or (assoc-default :force-indent nim-smie--line-info) indent)))))
  (let* ((empty-line-indent (and t (assoc-default :force-indent nim-smie--line-info)))) (if empty-line-indent empty-line-indent (let* ((savep (point)) (indent (or (condition-case err (save-excursion (forward-line 0) (skip-chars-forward " \011") (if (>= (point) savep) (setq savep nil)) (or (smie-indent-calculate) 0)) ((debug error) (message "Error: %S" err) nil)) 0))) (cond ((eq 'noindent indent) nil) ((assoc-default :comment nim-smie--line-info) (nim-get-comment-indent)) ((or (not (numberp indent)) (< indent 0)) 0) (t (or (assoc-default :force-indent nim-smie--line-info) indent))))))
  nim-smie-indent-calculate()
  (and t (nim-smie-indent-calculate))
  (let* ((indentation (and t (nim-smie-indent-calculate)))) (if indentation (let ((levels (nim-indent--calculate-levels indentation))) (if previous (nim-indent--previous-level levels (current-indentation)) (if levels (apply (function max) levels) 0)))))
  nim-indent-calculate-indentation(nil)
  (and t (nim-indent-calculate-indentation previous))
  (let* ((indent (and t (nim-indent-calculate-indentation previous)))) (if indent (progn (indent-line-to indent) (run-hooks 'nim-smie-after-indent-hook))))
  (save-excursion (let* ((indent (and t (nim-indent-calculate-indentation previous)))) (if indent (progn (indent-line-to indent) (run-hooks 'nim-smie-after-indent-hook)))))
  (let ((follow-indentation-p (and (<= (line-beginning-position) (point)) (>= (+ (line-beginning-position) (current-indentation)) (point))))) (save-excursion (let* ((indent (and t (nim-indent-calculate-indentation previous)))) (if indent (progn (indent-line-to indent) (run-hooks 'nim-smie-after-indent-hook))))) (if follow-indentation-p (progn (back-to-indentation))))
  nim--indent-line-core(nil)
  nim-indent-line()
  indent-according-to-mode()
  newline-and-indent()
  funcall-interactively(newline-and-indent)
  call-interactively(newline-and-indent nil nil)
  command-execute(newline-and-indent)
@krux02 krux02 added the bug label May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant