packages feed

hyperscript (empty) → 0.1.0.0

raw patch · 10 files changed

+290/−0 lines, 10 filesdep +basedep +hyperscriptdep +megaparsecsetup-changed

Dependencies added: base, hyperscript, megaparsec, text

Files

+ ChangeLog.md view
@@ -0,0 +1,3 @@+# Changelog for hyperscript++## Unreleased changes
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright Monadic Systems LLC (c) 2022++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++    * Redistributions of source code must retain the above copyright+      notice, this list of conditions and the following disclaimer.++    * Redistributions in binary form must reproduce the above+      copyright notice, this list of conditions and the following+      disclaimer in the documentation and/or other materials provided+      with the distribution.++    * Neither the name of Monadic Systems LLC nor the names of other+      contributors may be used to endorse or promote products derived+      from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,1 @@+# hyperscript
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ app/Main.hs view
@@ -0,0 +1,4 @@+module Main where++main :: IO ()+main = print "A _hyperscript parser"
+ hyperscript.cabal view
@@ -0,0 +1,62 @@+cabal-version:      1.12+name:               hyperscript+version:            0.1.0.0+license:            BSD3+license-file:       LICENSE+copyright:          2022 Monadic Systems LLC+maintainer:         tech@monadic.systems+author:             Monadic Systems LLC+homepage:           https://github.com/MonadicSystems/hyperscript#readme+bug-reports:        https://github.com/MonadicSystems/hyperscript/issues+synopsis:           A parser for the _hyperscript programming language+description:+    Please see the README on GitHub at <https://github.com/githubuser/hyperscript#readme>++category:           Web+build-type:         Simple+extra-source-files:+    README.md+    ChangeLog.md++source-repository head+    type:     git+    location: https://github.com/MonadicSystems/hyperscript++library+    exposed-modules:+        Hyperscript+        Hyperscript.Lexer+        Hyperscript.Parser++    hs-source-dirs:   src+    other-modules:    Paths_hyperscript+    default-language: Haskell2010+    build-depends:+        base >=4.7 && <5,+        megaparsec >=9.0.1 && <9.1,+        text >=1.2.4.1 && <1.3++executable hyperscript-exe+    main-is:          Main.hs+    hs-source-dirs:   app+    other-modules:    Paths_hyperscript+    default-language: Haskell2010+    ghc-options:      -threaded -rtsopts -with-rtsopts=-N+    build-depends:+        base >=4.7 && <5,+        hyperscript -any,+        megaparsec >=9.0.1 && <9.1,+        text >=1.2.4.1 && <1.3++test-suite hyperscript-test+    type:             exitcode-stdio-1.0+    main-is:          Spec.hs+    hs-source-dirs:   test+    other-modules:    Paths_hyperscript+    default-language: Haskell2010+    ghc-options:      -threaded -rtsopts -with-rtsopts=-N+    build-depends:+        base >=4.7 && <5,+        hyperscript -any,+        megaparsec >=9.0.1 && <9.1,+        text >=1.2.4.1 && <1.3
+ src/Hyperscript.hs view
@@ -0,0 +1,4 @@+module Hyperscript where++import Hyperscript.Lexer+import Hyperscript.Parser
+ src/Hyperscript/Lexer.hs view
@@ -0,0 +1,1 @@+module Hyperscript.Lexer where
+ src/Hyperscript/Parser.hs view
@@ -0,0 +1,181 @@+{-# LANGUAGE OverloadedStrings #-}++module Hyperscript.Parser where++import Data.Text (Text)+import Data.Void (Void)+import Text.Megaparsec (Parsec)+import qualified Text.Megaparsec.Char as C+import qualified Text.Megaparsec.Char.Lexer as L++data Error = Error deriving (Eq, Ord)++type Parser = Parsec Void Text++data HsLexemes+  = PLUS+  | MINUS+  | MULTIPLY+  | DIVIDE+  | PERIOD+  | ELLIPSIS+  | BACKSLASH+  | COLON+  | PERCENT+  | PIPE+  | EXCLAMATION+  | QUESTION+  | POUND+  | AMPERSAND+  | DOLLAR+  | SEMI+  | COMMA+  | L_PAREN+  | R_PAREN+  | L_ANG+  | R_ANG+  | LTE_ANG+  | GTE_ANG+  | EQ_+  | EQQ+  | NEQ+  | NEQQ+  | L_BRACE+  | R_BRACE+  | L_BRACKET+  | R_BRACKET+  | EQUALS+  deriving (Eq, Show)++space :: Parser ()+space = L.space C.space1 (L.skipLineComment "--") (L.skipBlockComment "{-" "-}")++symbol = L.symbol space++plus = do+  symbol "+"+  pure PLUS++minus = do+  symbol "-"+  pure MINUS++multiply = do+  symbol "*"+  pure MULTIPLY++divide = do+  symbol "/"+  pure DIVIDE++period = do+  symbol "."+  pure PERIOD++ellipsis = do+  symbol ".."+  pure ELLIPSIS++backslash = do+  symbol "\\"+  pure BACKSLASH++colon = do+  symbol ":"+  pure COLON++percent = do+  symbol "%"+  pure PERCENT++pipe = do+  symbol "|"+  pure PIPE++exclamation = do+  symbol "!"+  pure EXCLAMATION++question = do+  symbol "?"+  pure QUESTION++pound = do+  symbol "#"+  pure POUND++ampersand = do+  symbol "&"+  pure AMPERSAND++dollar = do+  symbol "$"+  pure DOLLAR++semi = do+  symbol ";"+  pure SEMI++comma = do+  symbol ","+  pure COMMA++lParen = do+  symbol "("+  pure L_PAREN++rParen = do+  symbol ")"+  pure R_PAREN++lAng = do+  symbol "<"+  pure L_ANG++rAng = do+  symbol ">"+  pure R_ANG++lteAng = do+  symbol "<="+  pure LTE_ANG++gteAng = do+  symbol ">="+  pure GTE_ANG++eq = do+  symbol "=="+  pure EQ_++eqq = do+  symbol "==="+  pure EQQ++neq = do+  symbol "!="+  pure NEQ++neqq = do+  symbol "!=="+  pure NEQQ++lBrace = do+  symbol "{"+  pure L_BRACE++rBrace = do+  symbol "}"+  pure R_BRACE++lBracket = do+  symbol "["+  pure L_BRACKET++rBracket = do+  symbol "]"+  pure R_BRACKET++equals = do+  symbol "="+  pure EQUALS
+ test/Spec.hs view
@@ -0,0 +1,2 @@+main :: IO ()+main = putStrLn "Test suite not yet implemented"