From 02c19b31709e8173cfec90dc03683d4753ac9c60 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Wed, 30 Dec 2009 15:10:47 -0500 Subject: [PATCH] patching up the lexer and adding a test with trailing whitespace (it was too string for trailing whitespace before) --- lib/coffee_script/lexer.rb | 2 +- test/fixtures/execution/test_calling_super.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/coffee_script/lexer.rb b/lib/coffee_script/lexer.rb index 20f227ca..27f0795e 100644 --- a/lib/coffee_script/lexer.rb +++ b/lib/coffee_script/lexer.rb @@ -27,7 +27,7 @@ module CoffeeScript COMMENT = /\A((#[^\n]*\s*)+)/m CODE = /\A(=>)/ REGEX = /\A(\/(.*?)[^\\]\/[imgy]{0,4})/ - MULTI_DENT = /\A((\n+[ \t]*)+)/ + MULTI_DENT = /\A((\n+([ \t]*(?=\S)))+)/ LAST_DENT = /\n+([ \t]*)\Z/ # Token cleaning regexes. diff --git a/test/fixtures/execution/test_calling_super.coffee b/test/fixtures/execution/test_calling_super.coffee index d2d6ed0d..8a9d4bc1 100644 --- a/test/fixtures/execution/test_calling_super.coffee +++ b/test/fixtures/execution/test_calling_super.coffee @@ -6,12 +6,12 @@ FirstChild: => FirstChild extends Base FirstChild.prototype.func: string => super('one/') + string - + SecondChild: => SecondChild extends FirstChild SecondChild.prototype.func: string => super('two/') + string - + ThirdChild: => ThirdChild extends SecondChild ThirdChild.prototype.func: string =>