From b4de17d50408efa3db058d620e7c0930ebd6bb43 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Mon, 23 Aug 2010 20:33:18 -0400 Subject: [PATCH] more tweaks to the herecomment regex. --- lib/lexer.js | 2 +- src/lexer.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lexer.js b/lib/lexer.js index fde8b3e4..e847085d 100644 --- a/lib/lexer.js +++ b/lib/lexer.js @@ -603,7 +603,7 @@ HEREDOC = /^("{6}|'{6}|"{3}\n?([\s\S]*?)\n?([ \t]*)"{3}|'{3}\n?([\s\S]*?)\n?([ \t]*)'{3})/; OPERATOR = /^(-[\-=>]?|\+[+=]?|[*&|\/%=<>^:!?]+)([ \t]*)/; WHITESPACE = /^([ \t]+)/; - COMMENT = /^(\s*\#{3}(?!#)([\s\S]*?)\#{3}[ \t]*\n|(\s*#(?!##[^#])[^\n]*)+)/; + COMMENT = /^(\s*###(?!#)([\s\S]*?)(###[ \t]*\n|(###)?$)|(\s*#(?!##[^#])[^\n]*)+)/; CODE = /^((-|=)>)/; MULTI_DENT = /^((\n([ \t]*))+)(\.)?/; LAST_DENTS = /\n([ \t]*)/g; diff --git a/src/lexer.coffee b/src/lexer.coffee index eb01f23a..483023dc 100644 --- a/src/lexer.coffee +++ b/src/lexer.coffee @@ -520,7 +520,7 @@ NUMBER = /^(((\b0(x|X)[0-9a-fA-F]+)|((\b[0-9]+(\.[0-9]+)?|\.[0-9]+)(e[+\- HEREDOC = /^("{6}|'{6}|"{3}\n?([\s\S]*?)\n?([ \t]*)"{3}|'{3}\n?([\s\S]*?)\n?([ \t]*)'{3})/ OPERATOR = /^(-[\-=>]?|\+[+=]?|[*&|\/%=<>^:!?]+)([ \t]*)/ WHITESPACE = /^([ \t]+)/ -COMMENT = /^(\s*\#{3}(?!#)([\s\S]*?)\#{3}[ \t]*\n|(\s*#(?!##[^#])[^\n]*)+)/ +COMMENT = /^(\s*###(?!#)([\s\S]*?)(###[ \t]*\n|(###)?$)|(\s*#(?!##[^#])[^\n]*)+)/ CODE = /^((-|=)>)/ MULTI_DENT = /^((\n([ \t]*))+)(\.)?/ LAST_DENTS = /\n([ \t]*)/g