Skip to content

Commit

Permalink
Rename JScript to JS
Browse files Browse the repository at this point in the history
  • Loading branch information
spockz committed Jan 29, 2012
1 parent b874550 commit ae159c3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion resources/static/hjs/Models.hs
Expand Up @@ -40,7 +40,7 @@ jsRule2Rule ptr = do id <- getAttr "id" ptr

proofTreeNode = Node "" "" [] ""

foreign import jscript "%1.rule"
foreign import js "%1.rule"
getRule :: JSRule -> JSString

hasValidTermSyntax :: String -> Bool
Expand Down
2 changes: 1 addition & 1 deletion resources/static/hjs/Worker.hs
Expand Up @@ -17,5 +17,5 @@ doCheck obj = do (proof, rules) <- getAttr "data" obj
self <- getSelf
postMessage self $ checkProof rules proof

foreign import jscript "JSON.parse(%1)"
foreign import js "JSON.parse(%1)"
jsonParse :: JSString -> IO a
10 changes: 7 additions & 3 deletions resources/static/hjs/jcu.hs
Expand Up @@ -212,9 +212,13 @@ replaceRuleTree p = do
-- Draw the new ruleTree
replaceWith oldUL newUL

case status of
(Node Correct _) -> showInfo "Congratulations! You have successfully completed your proof!"
case complete status of
True -> showInfo "Congratulations! You have successfully completed your proof!"
_ -> return ()
where complete :: PCheck -> Bool
complete (Node Correct []) = True
complete (Node Correct xs) = all complete xs
complete _ = False


addRules :: AjaxCallback (JSArray JSRule)
Expand Down Expand Up @@ -295,7 +299,7 @@ checkProof p = do rules <- jQuery ".rule-list-item" >>= jQueryToArray
-- where f x = getAttr "innerText" x
-- >>= return . fromJust . tryParseRule . (fromJS :: JSString -> String)

-- foreign import jscript "_deepe_"
-- foreign import js "_deepe_"
-- deepE :: a -> IO a

doSubst :: Proof -> EventHandler
Expand Down
4 changes: 2 additions & 2 deletions resources/static/hjs/makefile
@@ -1,5 +1,5 @@
# COMPILER = ${UHC} --import-path=${UHC_JSCRIPT} --import-path=${UHC_NANOPROLOG} --import-path=${UHC_UU_TC} -tjscript --no-recomp --no-hi-check -O,2 # --dump-core-stages=1
COMPILER = ${UHC} --import-path=${UHC_JSCRIPT} --import-path=${UHC_NANOPROLOG} --import-path=${UHC_UU_TC} -tjscript -O,2 # --no-recomp --no-hi-check --dump-core-stages=1
# COMPILER = ${UHC} --import-path=${UHC_JSCRIPT} --import-path=${UHC_NANOPROLOG} --import-path=${UHC_UU_TC} -tjs --no-recomp --no-hi-check -O,2 # --dump-core-stages=1
COMPILER = ${UHC} --import-path=${UHC_JSCRIPT} --import-path=${UHC_NANOPROLOG} --import-path=${UHC_UU_TC} -tjs -O,2 # --no-recomp --no-hi-check --dump-core-stages=1

all: build

Expand Down
2 changes: 1 addition & 1 deletion resources/static/hjs/testcases/alert.hs
Expand Up @@ -5,7 +5,7 @@ import Language.UHC.JScript.Types (fromJS)

import Language.UHC.JScript.ECMA.String (JSString)

foreign import jscript "window.location.href"
foreign import js "window.location.href"
windowHref :: JSString

main :: IO ()
Expand Down

0 comments on commit ae159c3

Please sign in to comment.