Ignore:
Timestamp:
Apr 17, 2014, 6:20:11 PM (5 years ago)
Author:
cameron
Message:

Update for SparseCharSet?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/RE/Haskell/REcompile.hs

    r3615 r3826  
    1212       
    1313import Data.Char
     14import SparseCharSet
    1415import CanonicalRE
    1516import REparse
     
    6465rep_helper :: (RE, Int, RepLimit, CodeGenState) -> CodeGenState
    6566
     67eol_CC = CharClass([CharRange(ord '\n', ord '\n')])
     68
    6669compile(re) = re2pablo_helper(re, (env, [Assign(marker, All(1))], marker))
    6770  where
     
    8487   where
    8588     (newenv, newsym) = gensym(env, "start_of_line_marker")
    86      new_stmt = Assign (newsym, And(Var(last_marker), Not(Advance(Not(CharClass("\n"))))))
     89     new_stmt = Assign (newsym, And(Var(last_marker), Not(Advance(Not(eol_CC)))))
    8790
    8891-- To match "$" we must have reached end of line.
     
    9194   where
    9295     (newenv, newsym) = gensym(env, "end_of_line_marker")
    93      new_stmt = Assign (newsym, And(Var(last_marker), CharClass("\n")))
     96     new_stmt = Assign (newsym, And(Var(last_marker), eol_CC))
    9497
    9598-- For the structured types (Seq, Alt, Rep), just call the specific helper.
Note: See TracChangeset for help on using the changeset viewer.