From 6ef984e25433608183004086f21a75e51209012c Mon Sep 17 00:00:00 2001 From: Marcin Mikołajczyk Date: Thu, 20 Feb 2014 15:27:43 +0100 Subject: Change actions syntax --- src/Actions.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Actions.hs') diff --git a/src/Actions.hs b/src/Actions.hs index 2befe77..8772b07 100644 --- a/src/Actions.hs +++ b/src/Actions.hs @@ -17,7 +17,7 @@ import Control.Monad (void) import Text.Regex (Regex, subRegex, mkRegex, matchRegex) import Graphics.X11.Types (Button) -data Action = Spawn Button String +data Action = Spawn [Button] String deriving (Eq) runAction :: Action -> IO () @@ -28,7 +28,7 @@ stripActions s = case matchRegex actionRegex s of Nothing -> s Just _ -> stripActions strippedOneLevel where - strippedOneLevel = subRegex actionRegex s $ "[\\1=\\2]\\3[\\4]" + strippedOneLevel = subRegex actionRegex s $ "[action=\\1\\2]\\3[/action]" actionRegex :: Regex -actionRegex = mkRegex "<(action|button.)=([^>]*)>(.+)" +actionRegex = mkRegex "`]*)`?( +button=[12345]+)?>(.+)" -- cgit v1.2.3