<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -95,6 +95,7 @@ module Rexical
         end
       end
       expr = st[0,ndx]
+      expr.gsub!('\ ', ' ')
       key  =  '{' + key + '}'
       @macro.each_pair do |k, e|
         expr.gsub!(k) { |m| e }</diff>
      <filename>lib/rexical/generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -76,6 +76,19 @@ end
                   [:NUMBER, 10]], calc
   end
 
+  def test_parses_macros_with_escapes
+    source = parse_lexer %q{
+class Foo
+macro
+  w  [\ \t]+
+rule
+  {w}  { [:SPACE, text] }
+end
+    }
+
+    assert source.index('@ss.scan(/[ \t]+/))')
+  end
+
   def test_simple_scanner_with_macros
     m = build_lexer %q{
 class Calculator</diff>
      <filename>test/test_generator.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d73e19e9a7791eac572b2310ef2e870f52eafb17</id>
    </parent>
  </parents>
  <author>
    <name>Carl Lerche</name>
    <email>carllerche@mac.com</email>
  </author>
  <url>http://github.com/tenderlove/rexical/commit/ecf4fbd7a986c1e616f8fa92d75a22e809923742</url>
  <id>ecf4fbd7a986c1e616f8fa92d75a22e809923742</id>
  <committed-date>2009-06-19T18:00:04-07:00</committed-date>
  <authored-date>2009-06-19T18:00:04-07:00</authored-date>
  <message>Spaces don't need to be escaped in regular expressions, but they do need to be in macros</message>
  <tree>42179cf07e54df3a0818fb8e1adaa35b29e5d640</tree>
  <committer>
    <name>Carl Lerche</name>
    <email>carllerche@mac.com</email>
  </committer>
</commit>
