on master help sign in
Also fixed issue where require-ing filenames with periods would end up unintentally having property access syntax
810b5dcRisto Stevcev
src/IRTS/JavaScript/Codegen.hs+2−4
@@ -83,12 +83,10 @@ includeLibs =
83 let
83 let
84 repl '\\' = '_'
84 repl '\\' = '_'
85 repl '/' = '_'
85 repl '/' = '_'
86+ repl '.' = '_'
86 repl c = c
87 repl c = c
87−
88− trimPeriod ('.' : xs) = '_' : xs
89− trimPeriod s = s
90 in
88 in
91− concatMap (\lib -> "var " ++ (trimPeriod $ repl <$> lib) ++ " = require(\"" ++ lib ++"\");\n")
89+ concatMap (\lib -> "var " ++ (repl <$> lib) ++ " = require(\"" ++ lib ++"\");\n")
92
90
93isYes :: Maybe String -> Bool
91isYes :: Maybe String -> Bool
94isYes (Just "Y") = True
92isYes (Just "Y") = True