Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into hash-globalpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Dec 4, 2024
2 parents a7ec169 + 021fc0c commit 5dacf3e
Show file tree
Hide file tree
Showing 100 changed files with 279 additions and 317 deletions.
9 changes: 9 additions & 0 deletions app/GlobalOptions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ data GlobalOptions = GlobalOptions
_globalNoPositivity :: Bool,
_globalNoCoverage :: Bool,
_globalNoStdlib :: Bool,
_globalNoCheck :: Bool,
_globalUnrollLimit :: Int,
_globalNumThreads :: NumThreads,
_globalFieldSize :: Maybe Natural,
Expand Down Expand Up @@ -72,6 +73,7 @@ defaultGlobalOptions =
_globalLogLevel = LogLevelProgress,
_globalNoCoverage = False,
_globalNoStdlib = False,
_globalNoCheck = False,
_globalUnrollLimit = defaultUnrollLimit,
_globalFieldSize = Nothing,
_globalDevShowThreadIds = False,
Expand Down Expand Up @@ -162,6 +164,11 @@ parseGlobalFlags = do
<> intercalate " < " [show l | l <- allElements @LogLevel]
)
)
_globalNoCheck <-
switch
( long "dev-no-check"
<> help "[DEV] Disable input sanity check in Core"
)
_globalShowNameIds <-
switch
( long "show-name-ids"
Expand Down Expand Up @@ -211,6 +218,7 @@ entryPointFromGlobalOptions root mainFile opts = do
_entryPointNoPositivity = opts ^. globalNoPositivity,
_entryPointNoCoverage = opts ^. globalNoCoverage,
_entryPointNoStdlib = opts ^. globalNoStdlib,
_entryPointNoCheck = opts ^. globalNoCheck,
_entryPointUnrollLimit = opts ^. globalUnrollLimit,
_entryPointGenericOptions = project opts,
_entryPointBuildDir = maybe (def ^. entryPointBuildDir) (CustomBuildDir . Abs) mabsBuildDir,
Expand All @@ -232,6 +240,7 @@ entryPointFromGlobalOptionsNoFile root opts = do
_entryPointNoPositivity = opts ^. globalNoPositivity,
_entryPointNoCoverage = opts ^. globalNoCoverage,
_entryPointNoStdlib = opts ^. globalNoStdlib,
_entryPointNoCheck = opts ^. globalNoCheck,
_entryPointUnrollLimit = opts ^. globalUnrollLimit,
_entryPointGenericOptions = project opts,
_entryPointBuildDir = maybe (def ^. entryPointBuildDir) (CustomBuildDir . Abs) mabsBuildDir,
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/Package.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Package;
import PackageDescription.V2 open;

package : Package :=
defaultPackage@?{
defaultPackage@{
name := "Demo";
version := mkVersion 0 1 0
};
2 changes: 1 addition & 1 deletion examples/midsquare/Package.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Package;
import PackageDescription.V2 open;

package : Package :=
defaultPackage@?{
defaultPackage@{
name := "midsquare";
version := mkVersion 0 1 0
};
2 changes: 1 addition & 1 deletion examples/milestone/Bank/Package.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module Package;
import PackageDescription.V2 open;

package : Package :=
defaultPackage@?{
defaultPackage@{
name := "bank"
};
2 changes: 1 addition & 1 deletion examples/milestone/Collatz/Package.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Package;
import PackageDescription.V2 open;

package : Package :=
defaultPackage@?{
defaultPackage@{
name := "Collatz";
version := mkVersion 0 1 0;
main := just "Collatz.juvix"
Expand Down
2 changes: 1 addition & 1 deletion examples/milestone/Fibonacci/Package.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Package;
import PackageDescription.V2 open;

package : Package :=
defaultPackage@?{
defaultPackage@{
name := "Fibonacci";
version := mkVersion 0 1 0;
main := just "Fibonacci.juvix"
Expand Down
2 changes: 1 addition & 1 deletion examples/milestone/Hanoi/Package.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Package;
import PackageDescription.V2 open;

package : Package :=
defaultPackage@?{
defaultPackage@{
name := "Hanoi";
version := mkVersion 0 1 0;
main := just "Hanoi.juvix"
Expand Down
2 changes: 1 addition & 1 deletion examples/milestone/HelloWorld/Package.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Package;
import PackageDescription.V2 open;

package : Package :=
defaultPackage@?{
defaultPackage@{
name := "HelloWorld";
version := mkVersion 0 1 0;
main := just "HelloWorld.juvix"
Expand Down
2 changes: 1 addition & 1 deletion examples/milestone/PascalsTriangle/Package.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Package;
import PackageDescription.V2 open;

package : Package :=
defaultPackage@?{
defaultPackage@{
name := "PascalsTriangle";
version := mkVersion 0 1 0;
main := just "PascalsTriangle.juvix"
Expand Down
2 changes: 1 addition & 1 deletion examples/milestone/TicTacToe/Package.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Package;
import PackageDescription.V2 open;

package : Package :=
defaultPackage@?{
defaultPackage@{
name := "TicTacToe";
version := mkVersion 0 1 0;
main := just "CLI/TicTacToe.juvix"
Expand Down
2 changes: 1 addition & 1 deletion examples/milestone/Tutorial/Package.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Package;
import PackageDescription.V2 open;

package : Package :=
defaultPackage@?{
defaultPackage@{
name := "Tutorial";
version := mkVersion 0 1 0
};
2 changes: 1 addition & 1 deletion include/package/PackageDescription/V1.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ mkVersion
{release : Maybe String := nothing}
{meta : Maybe String := nothing}
: SemVer :=
mkSemVer@?{
mkSemVer@{
major;
minor;
patch;
Expand Down
2 changes: 1 addition & 1 deletion include/package/PackageDescription/V2.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ mkVersion
{release : Maybe String := nothing}
{meta : Maybe String := nothing}
: SemVer :=
mkSemVer@?{
mkSemVer@{
major;
minor;
patch;
Expand Down
2 changes: 1 addition & 1 deletion juvix-stdlib
36 changes: 7 additions & 29 deletions src/Juvix/Compiler/Concrete/Gen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@ smallUniverseExpression = do
_expressionAtoms = pure (AtomUniverse (smallUniverse loc))
}

isExhaustive :: (Member (Reader Interval) r) => Bool -> Sem r IsExhaustive
isExhaustive _isExhaustive = do
_isExhaustiveKw <-
Irrelevant
<$> if
| _isExhaustive -> kw kwAt
| otherwise -> kw kwAtQuestion

return IsExhaustive {..}

symbol :: (Member (Reader Interval) r) => Text -> Sem r Symbol
symbol t = do
l <- ask
Expand Down Expand Up @@ -107,25 +97,13 @@ braced a = do
l <- ask
AtomBraces . WithLoc l <$> expressionAtoms' a

mkIsExhaustive :: (Member (Reader Interval) r) => Bool -> Sem r IsExhaustive
mkIsExhaustive _isExhaustive = do
keyw <-
if
| _isExhaustive -> kw kwAt
| otherwise -> kw kwAtQuestion
return
IsExhaustive
{ _isExhaustiveKw = Irrelevant keyw,
_isExhaustive
}

namedApplication :: Name -> IsExhaustive -> [NamedArgumentNew 'Parsed] -> ExpressionAtom 'Parsed
namedApplication n exh as =
AtomNamedApplicationNew
NamedApplicationNew
{ _namedApplicationNewName = n,
_namedApplicationNewExhaustive = exh,
_namedApplicationNewArguments = as
namedApplication :: Name -> Irrelevant KeywordRef -> [NamedArgument 'Parsed] -> ExpressionAtom 'Parsed
namedApplication n kwd as =
AtomNamedApplication
NamedApplication
{ _namedApplicationName = n,
_namedApplicationAtKw = kwd,
_namedApplicationArguments = as
}

literalInteger :: (Member (Reader Interval) r, Integral a) => a -> Sem r (ExpressionAtom 'Parsed)
Expand Down
2 changes: 0 additions & 2 deletions src/Juvix/Compiler/Concrete/Keywords.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import Juvix.Data.Keyword.All
kwAssign,
kwAssoc,
kwAt,
kwAtQuestion,
kwAxiom,
kwBelow,
kwBinary,
Expand Down Expand Up @@ -88,7 +87,6 @@ reservedKeywords =
kwAssign,
kwDeriving,
kwAt,
kwAtQuestion,
kwAxiom,
kwCase,
kwColon,
Expand Down
Loading

0 comments on commit 5dacf3e

Please sign in to comment.