Skip to content

Commit

Permalink
finally fix CI in the dumbest possible way
Browse files Browse the repository at this point in the history
  • Loading branch information
bristermitten committed Aug 6, 2023
1 parent e6412c7 commit b067c2a
Show file tree
Hide file tree
Showing 13 changed files with 197 additions and 207 deletions.
5 changes: 4 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ run:
ghcid -c "cabal v2-repl exe:converter" --warnings -T :main

bnfc:
rm -rf templatespiler-bnf/src && bnfc --haskell --text-token --functor --generic -d -p Language -o templatespiler-bnf/src templatespiler.cf && mv templatespiler-bnf/src/Language/Templatespiler/Test.hs templatespiler-bnf/src/Main.hs # stupid dumb hack to make cabal work
rm -rf templatespiler-bnf/src
bnfc --haskell --text-token --functor --generic -d -p Language -o templatespiler-bnf/src templatespiler.cf
mv templatespiler-bnf/src/Language/Templatespiler/Test.hs templatespiler-bnf/src/Main.hs # stupid dumb hack to make cabal work
find templatespiler-bnf -name "*.hs" -exec sed -i "1s/^/{- HLINT ignore -}\n{- FOURMOLU_DISABLE -}\n/" {} + # stupid dumb hack to make hlint and fourmolu work (we just skip them for generated code)
86 changes: 0 additions & 86 deletions templatespiler-bnf/.src/Main.hs

This file was deleted.

2 changes: 1 addition & 1 deletion templatespiler-bnf/bnf.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ author: Alexander Wood
category: Web

common shared
hs-source-dirs: .src
hs-source-dirs: src
build-depends:
, array
, base
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{- HLINT ignore -}
{- FOURMOLU_DISABLE -}
-- File generated by the BNF Converter (bnfc 2.9.4.1).

{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
Expand All @@ -8,32 +11,27 @@
{-# LANGUAGE PatternSynonyms #-}

-- | The abstract syntax of language templatespiler.

module Language.Templatespiler.Abs where

import Data.String qualified
import Prelude (Integer, String)
import Prelude qualified as C (
Eq,
Foldable,
Functor,
Int,
Maybe (..),
Ord,
Read,
Show,
Traversable,
)

import Data.Data qualified as C (Data, Typeable)
import Data.Text qualified
import GHC.Generics qualified as C (Generic)
import qualified Prelude as C
( Eq, Ord, Show, Read
, Functor, Foldable, Traversable
, Int, Maybe(..)
)
import qualified Data.String

import qualified Data.Text
import qualified Data.Data as C (Data, Typeable)
import qualified GHC.Generics as C (Generic)

type Type = Type' BNFC'Position
data Type' a
= IntegerType a
| StringType a
| FloatType a
| CombinatorType a (Combinator' a)
= IntegerType a
| StringType a
| FloatType a
| CombinatorType a (Combinator' a)
deriving (C.Eq, C.Ord, C.Show, C.Read, C.Functor, C.Foldable, C.Traversable, C.Data, C.Typeable, C.Generic)

type Binding = Binding' BNFC'Position
Expand All @@ -46,17 +44,17 @@ data BindingGroup' a = BindingGroup a [Binding' a]

type BindingOrCombinator = BindingOrCombinator' BNFC'Position
data BindingOrCombinator' a
= NamedBinding a (Binding' a)
| ParenBinding a (Binding' a)
| UnnamedBinding a (Combinator' a)
= NamedBinding a (Binding' a)
| ParenBinding a (Binding' a)
| UnnamedBinding a (Combinator' a)
deriving (C.Eq, C.Ord, C.Show, C.Read, C.Functor, C.Foldable, C.Traversable, C.Data, C.Typeable, C.Generic)

type Combinator = Combinator' BNFC'Position
data Combinator' a
= ParenCombinator a (Combinator' a)
| ArrayCombinator a (VarOrConstInt' a) (BindingOrCombinator' a)
| SepByCombinator a String (BindingGroup' a)
| ListCombinator a (BindingOrCombinator' a)
= ParenCombinator a (Combinator' a)
| ArrayCombinator a (VarOrConstInt' a) (BindingOrCombinator' a)
| SepByCombinator a String (BindingGroup' a)
| ListCombinator a (BindingOrCombinator' a)
deriving (C.Eq, C.Ord, C.Show, C.Read, C.Functor, C.Foldable, C.Traversable, C.Data, C.Typeable, C.Generic)

type VarOrConstInt = VarOrConstInt' BNFC'Position
Expand All @@ -71,6 +69,7 @@ newtype Ident = Ident Data.Text.Text
deriving (C.Eq, C.Ord, C.Show, C.Read, C.Data, C.Typeable, C.Generic, Data.String.IsString)

-- | Start position (line, column) of something.

type BNFC'Position = C.Maybe (C.Int, C.Int)

pattern BNFC'NoPosition :: BNFC'Position
Expand All @@ -80,6 +79,7 @@ pattern BNFC'Position :: C.Int -> C.Int -> BNFC'Position
pattern BNFC'Position line col = C.Just (line, col)

-- | Get the start position of something.

class HasPosition a where
hasPosition :: a -> BNFC'Position

Expand Down Expand Up @@ -119,3 +119,4 @@ instance HasPosition VarOrConstInt where
instance HasPosition BindingList where
hasPosition = \case
BindingList p _ -> p

Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{- HLINT ignore -}
{- FOURMOLU_DISABLE -}
-- File generated by the BNF Converter (bnfc 2.9.4.1).

{-# LANGUAGE CPP #-}

#if __GLASGOW_HASKELL__ >= 708
Expand Down
Loading

0 comments on commit b067c2a

Please sign in to comment.