From e1abfa064ce2091506909f88d42c9a95bdef09c2 Mon Sep 17 00:00:00 2001 From: Joeri Samson Date: Sat, 22 Aug 2009 23:36:44 +0200 Subject: [PATCH] Enable trailing whitespace Also add trailing whitespace to sanity test as a primitive regression test --- src/parser/grammar.pg | 2 +- t/00-sanity.t | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/parser/grammar.pg b/src/parser/grammar.pg index 9185e35..f296f02 100644 --- a/src/parser/grammar.pg +++ b/src/parser/grammar.pg @@ -29,7 +29,7 @@ rule stmts { <.term>?[ [<.term>+ | <.before > | $ | ] ]* {*} } -token term { \n | ';' } +token term { \h*\n | \h*';' } token end_block { <.ws> [ 'end' | '}' ] } token basic_stmt { diff --git a/t/00-sanity.t b/t/00-sanity.t index 44eb1b8..91d6d0e 100644 --- a/t/00-sanity.t +++ b/t/00-sanity.t @@ -5,13 +5,13 @@ puts "1..5" if 1 # comments work! # -puts "ok 1" - +puts "ok 1" + puts "ok 2" ; puts "ok 3" - + print "ok "; print 1 + 3; print "\n" - + print "ok #{ 2 * 2 + 1 }\n" - + ; ; ; # Trailing whitespace should not be a problem for the code