[Pkg-javascript-commits] [less.js] 47/58: pick up comments on the end of the file

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:28:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.3.0
in repository less.js.

commit 5e6e16ed8ce9aed18b0ce71460891b47593612bd
Author: Luke Page <luke.a.page at gmail.com>
Date:   Mon Jan 26 19:52:56 2015 +0000

    pick up comments on the end of the file
---
 lib/less/parser/parser.js | 6 +++++-
 test/css/comments.css     | 1 +
 test/less/comments.less   | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/less/parser/parser.js b/lib/less/parser/parser.js
index f1cf119..64a4641 100644
--- a/lib/less/parser/parser.js
+++ b/lib/less/parser/parser.js
@@ -231,13 +231,17 @@ var Parser = function Parser(context, imports, fileInfo) {
             primary: function () {
                 var mixin = this.mixin, root = [], node;
 
-                while (!parserInput.finished)
+                while (true)
                 {
                     while(true) {
                         node = this.comment();
                         if (!node) { break; }
                         root.push(node);
                     }
+	                // always process comments before deciding if finished
+	                if (parserInput.finished) {
+		                break;
+	                }
                     if (parserInput.peek('}')) {
                         break;
                     }
diff --git a/test/css/comments.css b/test/css/comments.css
index 31e23f7..c8475cd 100644
--- a/test/css/comments.css
+++ b/test/css/comments.css
@@ -80,3 +80,4 @@
 #output-block {
   comment: /* // Not commented out // */;
 }
+/*comment on last line*/
diff --git a/test/less/comments.less b/test/less/comments.less
index 3cb6d16..e1d66e8 100644
--- a/test/less/comments.less
+++ b/test/less/comments.less
@@ -99,3 +99,4 @@
 /*by block */
 @string_w_comment: ~"/* // Not commented out // */";
 #output-block { comment: @string_w_comment; }
+/*comment on last line*/
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list