Changeset 14624 for src/Pugs/Parser

Show
Ignore:
Timestamp:
11/05/06 03:22:19 (2 years ago)
Author:
audreyt
svk:copy_cache_prev:
41990
Message:

* Pugs.Parser.Types: insertIntoPosition now takes a String, not Char,

so we can more freely conjure snippets that user had not written

from thin air.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Parser/Types.hs

    r14167 r14624  
    347347Modify the input stream by inserting a single 'Char' as the next thing to parse. 
    348348-} 
    349 insertIntoPosition :: Char -> RuleParser () 
    350 insertIntoPosition ch = do 
     349insertIntoPosition :: String -> RuleParser () 
     350insertIntoPosition str = do 
    351351    currPos <- getPosition 
    352     input <- getInput  
    353     setInput (ch:input) 
    354     setPosition (setSourceColumn currPos (sourceColumn currPos - 1)) 
     352    input   <- getInput  
     353    setInput (str ++ input) 
     354    setPosition (setSourceColumn currPos (sourceColumn currPos - length str))