You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Go to file
Hugo Thunnissen 4430aaccb9 Rework parser code
The parser is now JIT compiled. Parser functions are generated and byte-compiled on the
fly as needed and stored in an obarray. Handler functions are stored in an obarray as well
and are compiled at load time. See docstrings and code for more information.

Macro use has been brought back to a minimum and macros have been reworked to make the
code easier to reason about.

To be able to redifine parser functions during runtime,
"M-x phpinspect-purge-parser-cache" has been added.

To redifine a handler function, one can use `phpinspect-defhandler` after loading
phpinspect.el and purge the parser cache to make sure that the new function definition is
used.
3 years ago
test Add more tests for the parser code 3 years ago
COPYING Add license information 3 years ago
README.md Implement some general tests for the parser code 3 years ago
phpinspect-index.bash Truncate "uses_own" index file before filling the index 3 years ago
phpinspect.el Rework parser code 3 years ago

README.md

phpinspect.el

WIP. Documentation is in the making.

Example config:

;;;###autoload
(defun my-php-personal-hook ()
  (setq-local company-minimum-prefix-length 0)
  (setq-local company-tooltip-align-annotations t)
  (setq-local company-idle-delay 0.1)
  (setq-local company-backends '(phpinspect-company-backend))

  ;; Shortcut to add use statements for classes you use.
  (define-key php-mode-map (kbd "C-c u") 'phpinspect-fix-uses-interactive)

  ;; Shortcuts to quickly search/open files of PHP classes.
  (global-set-key (kbd "C-c a") 'phpinspect-find-class-file)
  (global-set-key (kbd "C-c c") 'phpinspect-find-own-class-file)

  (phpinspect-mode))

(add-hook 'php-mode-hook #'my-php-personal-hook)

Development

Running tests

Tests are implemented using ert. You can run them in batch mode with the following command:

emacs -batch -l ert -l ./phpinspect.el -l ./test/phpinspect-test.el -f ert-run-tests-batch-and-exit