Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit d17e80a

Browse files
authored
Merge pull request #8 from slamdata/xpath-expr
Don't use the XPath types, some expressions cannot be expressed by the library still
2 parents 4d9cbe0 + 45c1ca4 commit d17e80a

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

bower.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"purescript-argonaut-core": "^5.0.0",
3131
"purescript-css": "^4.0.0",
3232
"purescript-node-fs-aff": "^6.0.0",
33-
"purescript-run": "^3.0.0",
34-
"purescript-xpath": "cryogenian/purescript-xpath#compiler/0.12"
33+
"purescript-run": "^3.0.0"
3534
}
3635
}

src/Lunapark/Types.purs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ module Lunapark.Types where
55

66
import Prelude
77

8-
import CSS.Render as CSSR
9-
import CSS.Selector as CSS
8+
import CSS as CSS
109
import Control.Alt ((<|>))
1110
import Data.Argonaut.Core (Json)
1211
import Data.Argonaut.Core (Json, jsonEmptyObject, jsonNull) as J
@@ -25,8 +24,6 @@ import Data.Time.Duration (Milliseconds(..))
2524
import Data.Traversable as F
2625
import Data.Tuple (Tuple(..))
2726
import Data.Variant as V
28-
import Data.XPath.AST as XA
29-
import Data.XPath.Printer (printSelector)
3027
import Foreign.Object as FO
3128
import Node.Encoding as NE
3229
import Node.Path (FilePath)
@@ -174,7 +171,7 @@ encodeRectangle r = J.encodeJson $ FO.fromFoldable
174171

175172
data Locator
176173
= ByCss CSS.Selector
177-
| ByXPath XA.Selector
174+
| ByXPath String
178175
| ByTagName String
179176
| ByLinkText String
180177
| ByPartialLinkText String
@@ -189,11 +186,11 @@ encodeLocator ∷ Locator → Json
189186
encodeLocator l = J.encodeJson $ FO.fromFoldable case l of
190187
ByCss sel →
191188
[ Tuple "using" "css selector"
192-
, Tuple "value" $ CSSR.selector sel
189+
, Tuple "value" $ CSS.selector sel
193190
]
194-
ByXPath sel
191+
ByXPath expr
195192
[ Tuple "using" "xpath"
196-
, Tuple "value" $ printSelector sel
193+
, Tuple "value" expr
197194
]
198195
ByLinkText sel →
199196
[ Tuple "using" "link text"

0 commit comments

Comments
 (0)