[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode a61ff64 134/405: Renamed function get-point-d
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode a61ff64 134/405: Renamed function get-point-data to get-current-line-data for better semantics |
Date: |
Sat, 13 Jul 2019 09:59:59 -0400 (EDT) |
branch: externals/phps-mode
commit a61ff6475ff2418c4d0049b0967626df46ad92d3
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Renamed function get-point-data to get-current-line-data for better
semantics
---
phps-mode-functions.el | 6 ++---
phps-mode-test-functions.el | 66 ++++++++++++++++++++++-----------------------
2 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index b37ecc4..76fe89f 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -40,7 +40,7 @@
(defun phps-mode-functions-indent-line ()
"Indent line."
- (let ((data (phps-mode-functions-get-point-data))
+ (let ((data (phps-mode-functions-get-current-line-data))
(line-start (line-beginning-position)))
(let* ((start (nth 0 data))
(end (nth 1 data))
@@ -205,8 +205,8 @@
;; TODO Support switch case as well
;; TODO Keep track of assignments as well
-(defun phps-mode-functions-get-point-data ()
- "Return information about point in tokens."
+(defun phps-mode-functions-get-current-line-data ()
+ "Return information about current line in tokens."
;; (message "Point: %s in %s" (point) phps-mode-lexer-tokens)
(when (boundp 'phps-mode-lexer-tokens)
(save-excursion
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index 7e20de7..430ec92 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -31,7 +31,7 @@
(autoload 'phps-mode-test-with-buffer "phps-mode-test")
(autoload 'phps-mode-functions-indent-line "phps-mode-functions")
-(autoload 'phps-mode-functions-get-point-data "phps-mode-functions")
+(autoload 'phps-mode-functions-get-current-line-data "phps-mode-functions")
(autoload 'should "ert")
;; TODO Add unit tests for HEREDOC and NOWDOC regions as well
@@ -245,162 +245,162 @@
)
-(defun phps-mode-test-functions-get-point-data ()
+(defun phps-mode-test-functions-get-current-line-data ()
"Return information about point in tokens."
(phps-mode-test-with-buffer
"<?php\nNAMESPACE MyNameSpace;\nCLASS MyClass {\n\tpublic function
__construct() {\n\t\texit;\n\t}\n}\n"
(goto-char 35)
- (should (equal (list (list t 0 0 0 0 0 3 nil) (list t 1 0 0 0 0 6 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 0 3 nil) (list t 1 0 0 0 0 6 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<html><head><title><?php echo $title; ?></title><body>Bla
bla</body></html>"
(goto-char 15)
- (should (equal (list (list nil 0 0 0 0 0 nil nil) (list nil 0 0 0 0 0 5
nil)) (phps-mode-functions-get-point-data))))
+ (should (equal (list (list nil 0 0 0 0 0 nil nil) (list nil 0 0 0 0 0 5
nil)) (phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<html><head><title><?php echo $title; ?>\n</title><body>Bla
bla</body></html>"
(goto-char 50)
- (should (equal (list (list nil 0 0 0 0 0 nil nil) (list nil 0 0 0 0 0 nil
nil)) (phps-mode-functions-get-point-data))))
+ (should (equal (list (list nil 0 0 0 0 0 nil nil) (list nil 0 0 0 0 0 nil
nil)) (phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<html><head><title></title><body>Bla bla</body></html>"
(goto-char 15)
- (should (equal (list (list nil 0 0 0 0 0 nil nil) (list nil 0 0 0 0 0 nil
nil)) (phps-mode-functions-get-point-data))))
+ (should (equal (list (list nil 0 0 0 0 0 nil nil) (list nil 0 0 0 0 0 nil
nil)) (phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<html><head><title><?php echo $title; ?></title><body>Bla
bla</body></html>"
(goto-char 30)
- (should (equal (list (list nil 0 0 0 0 0 nil nil) (list nil 0 0 0 0 0 5
nil)) (phps-mode-functions-get-point-data))))
+ (should (equal (list (list nil 0 0 0 0 0 nil nil) (list nil 0 0 0 0 0 5
nil)) (phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<html><head><title><?php echo $title; ?></title><body>Bla
bla</body></html>"
(goto-char 50)
- (should (equal (list (list nil 0 0 0 0 0 nil nil) (list nil 0 0 0 0 0 5
nil)) (phps-mode-functions-get-point-data))))
+ (should (equal (list (list nil 0 0 0 0 0 nil nil) (list nil 0 0 0 0 0 5
nil)) (phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<html><head><title><?php if ($myCondition) { \n if ($mySeconCondition) {
echo $title; } } ?></title><body>Bla bla</body></html>"
(goto-char 48)
- (should (equal (list (list t 1 0 0 0 0 5 nil) (list nil 0 0 0 0 0 17 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 1 0 0 0 0 5 nil) (list nil 0 0 0 0 0 17 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<html><head><title><?php if ($myCondition) { if ($mySeconCondition) {\n
echo $title;\n} } ?></title><body>Bla bla</body></html>"
(goto-char 72)
- (should (equal (list (list t 2 0 0 0 0 10 nil) (list t 2 0 0 0 0 13 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 2 0 0 0 0 10 nil) (list t 2 0 0 0 0 13 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<html><head><title><?php if ($myCondition) {\nif ($mySeconCondition)
{\necho $title;\n}\n}\n ?></title><body>Bla bla</body></html>"
(goto-char 84)
- (should (equal (list (list t 2 0 0 0 0 13 nil) (list t 1 0 0 0 0 14 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 2 0 0 0 0 13 nil) (list t 1 0 0 0 0 14 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<html><head><title><?php if ($myCondition) { if ($mySeconCondition) { echo
$title; } } ?></title><body>Bla bla</body></html>"
(goto-char 100)
- (should (equal (list (list nil 0 0 0 0 0 nil nil) (list nil 0 0 0 0 0 17
nil)) (phps-mode-functions-get-point-data))))
+ (should (equal (list (list nil 0 0 0 0 0 nil nil) (list nil 0 0 0 0 0 17
nil)) (phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php /**\n * My first line\n * My second line\n **/"
(goto-char 20)
- (should (equal (list (list t 0 0 0 0 0 nil t) (list t 0 0 0 0 0 nil t))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 0 nil t) (list t 0 0 0 0 0 nil t))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php /**\n * My first line\n * My second line\n **/"
(goto-char 9)
- (should (equal (list (list nil 0 0 0 0 0 nil nil) (list t 0 0 0 0 0 1 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list nil 0 0 0 0 0 nil nil) (list t 0 0 0 0 0 1 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php /**\n * My first line\n * My second line\n **/"
(goto-char 50)
- (should (equal (list (list t 0 0 0 0 0 nil t) (list t 0 0 0 0 0 nil t))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 0 nil t) (list t 0 0 0 0 0 nil t))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\n$variable = array(\n'random4');\n$variable = true;\n"
(goto-char 29)
- (should (equal (list (list t 0 1 0 0 0 4 nil) (list t 0 0 0 0 0 7 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 1 0 0 0 4 nil) (list t 0 0 0 0 0 7 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\nif (empty(\n$this->var\n) && !empty($this->var)\n) {\n$this->var =
'abc123';\n}\n"
(goto-char 54)
- (should (equal (list (list t 0 1 0 0 0 16 nil) (list t 1 0 0 0 0 18 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 1 0 0 0 16 nil) (list t 1 0 0 0 0 18 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\n$var = [\n 'random' => [\n 'hello',\n ],\n];\n"
(goto-char 46)
- (should (equal (list (list t 0 0 2 0 0 6 nil) (list t 0 0 2 0 0 8 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 2 0 0 6 nil) (list t 0 0 2 0 0 8 nil))
(phps-mode-functions-get-current-line-data))))
;; INLINE SYNTAX FOR CONTROL STRUCTURES
(phps-mode-test-with-buffer
"<?php\nif ($myCondition)\n echo 'was here';\necho 'was here 2';\n"
(goto-char 41)
- (should (equal (list (list t 0 0 0 1 0 4 nil) (list t 0 0 0 0 0 7 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 1 0 4 nil) (list t 0 0 0 0 0 7 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\nif ($myCondition)\n echo 'was here';\necho 'was here 2';\n"
(goto-char 60)
- (should (equal (list (list t 0 0 0 0 0 7 nil) (list t 0 0 0 0 0 10 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 0 7 nil) (list t 0 0 0 0 0 10 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\nif ($myCondition) echo 'was here'; echo 'was here 2';\n"
(goto-char 32)
- (should (equal (list (list t 0 0 0 0 0 0 nil) (list t 0 0 0 0 0 10 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 0 0 nil) (list t 0 0 0 0 0 10 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\nif ($myCondition) echo 'was here'; echo 'was here 2';\n"
(goto-char 55)
- (should (equal (list (list t 0 0 0 0 0 0 nil) (list t 0 0 0 0 0 10 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 0 0 nil) (list t 0 0 0 0 0 10 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\nif ($myCondition)\n echo 'was here';\nelse\n echo 'was here
2';\n"
(goto-char 47)
- (should (equal (list (list t 0 0 0 0 0 7 nil) (list t 0 0 0 0 0 8 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 0 7 nil) (list t 0 0 0 0 0 8 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\nif ($myCondition)\n echo 'was here';\nelse\n echo 'was here
2';\n"
(goto-char 57)
- (should (equal (list (list t 0 0 0 1 0 8 nil) (list t 0 0 0 0 0 11 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 1 0 8 nil) (list t 0 0 0 0 0 11 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\nif ($myCondition)\n echo 'was here';\nelse\n echo 'was here
2';\n"
(goto-char 55)
- (should (equal (list (list t 0 0 0 1 0 8 nil) (list t 0 0 0 0 0 11 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 1 0 8 nil) (list t 0 0 0 0 0 11 nil))
(phps-mode-functions-get-current-line-data))))
;; ALTERNATIVE SYNTAX FOR CONTROL STRUCTURES
(phps-mode-test-with-buffer
"<?php\nif ($myCondition):\n echo 'was here';\nendif;\necho 'was here
2';\n"
(goto-char 41)
- (should (equal (list (list t 0 0 0 0 1 5 nil) (list t 0 0 0 0 1 8 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 1 5 nil) (list t 0 0 0 0 1 8 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\nif ($myCondition):\n echo 'was here';\nendif;\necho 'was here
3';\n"
(goto-char 52)
- (should (equal (list (list t 0 0 0 0 0 8 nil) (list t 0 0 0 0 0 10 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 0 8 nil) (list t 0 0 0 0 0 10 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\nif ($myCondition): echo 'was here';\nendif;\necho 'was here
4';\n"
(goto-char 32)
- (should (equal (list (list t 0 0 0 0 0 0 nil) (list t 0 0 0 0 1 8 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 0 0 nil) (list t 0 0 0 0 1 8 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\nif ($myCondition): echo 'was here'; endif; echo 'was here 5';\n"
(goto-char 35)
- (should (equal (list (list t 0 0 0 0 0 0 nil) (list t 0 0 0 0 0 13 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 0 0 nil) (list t 0 0 0 0 0 13 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\nif ($myCondition):\n echo 'was here';\nelse:\n echo 'was here
2';\nendif;\n"
(goto-char 44)
- (should (equal (list (list t 0 0 0 0 1 5 nil) (list t 0 0 0 0 1 8 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 1 5 nil) (list t 0 0 0 0 1 8 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\nif ($myCondition):\n echo 'was here';\nelse:\n echo 'was here
2';\nendif;\n"
(goto-char 64)
- (should (equal (list (list t 0 0 0 0 1 10 nil) (list t 0 0 0 0 1 13 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 1 10 nil) (list t 0 0 0 0 1 13 nil))
(phps-mode-functions-get-current-line-data))))
(phps-mode-test-with-buffer
"<?php\nif ($myCondition):\n echo 'was here';\nelse:\n echo 'was here
2';\nendif;\n"
(goto-char 79)
- (should (equal (list (list t 0 0 0 0 0 10 nil) (list t 0 0 0 0 0 15 nil))
(phps-mode-functions-get-point-data))))
+ (should (equal (list (list t 0 0 0 0 0 10 nil) (list t 0 0 0 0 0 15 nil))
(phps-mode-functions-get-current-line-data))))
;; TODO SWITCH, CASE, DEFAULT AS WELL
@@ -411,7 +411,7 @@
(defun phps-mode-test-functions ()
"Run test for functions."
;; (toggle-debug-on-error t)
- (phps-mode-test-functions-get-point-data)
+ (phps-mode-test-functions-get-current-line-data)
(phps-mode-test-functions-indent-line))
(phps-mode-test-functions)
- [elpa] externals/phps-mode c68c7a0 131/405: Fixed issue were first-token-on-line was nil, (continued)
- [elpa] externals/phps-mode c68c7a0 131/405: Fixed issue were first-token-on-line was nil, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c4ee0c3 132/405: Added more failing tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 0b3ced4 145/405: First test for new indentation function passes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 96588b5 142/405: More work on new indentation calculation functions, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 9d6af11 157/405: More work on indentations, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e249124 152/405: Prevent negative indent, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 4a27c44 147/405: Added support for naming unit tests to better find failures, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b852f5f 160/405: All tests for indentation passes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode dfb0427 151/405: Added unit test for round and square bracket expressions, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 7b8cea3 163/405: Added failing indentation test for class multiple implements, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a61ff64 134/405: Renamed function get-point-data to get-current-line-data for better semantics,
Stefan Monnier <=
- [elpa] externals/phps-mode b99da6b 153/405: Starting using new indentation calculation for indentations, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 6559760 166/405: Work on assignments and class declaration indentations, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 2720be8 165/405: Indentation calculation for heredoc and nowdoc assignments passes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 13c4c78 164/405: More work on heredoc, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 47ffc37 179/405: More work on refactored indentation calculation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a5ced61 158/405: New indentation function passes all original unit tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e3eedd7 167/405: Assignment indentation passes tests, class declaration remains, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e37c1cf 150/405: New indention calculation works with doc-comments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f789468 172/405: Took notes of new indentation tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 20e77aa 181/405: Removed debug output, Stefan Monnier, 2019/07/13