Skip to content

Commit

Permalink
Merge pull request #617 from objectionary/607-update-eo-to-0460
Browse files Browse the repository at this point in the history
607 update eo to 0.49.4
  • Loading branch information
deemp authored Dec 27, 2024
2 parents 22e04be + 1ac19e9 commit 18a461c
Show file tree
Hide file tree
Showing 243 changed files with 26,170 additions and 4,906 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/ghc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,15 @@ jobs:
if: always() && env.branch_is_not_master && runner.os == 'Linux' && steps.check-pipeline-lock.outputs.PIPELINE_LOCK_CHANGED
run: |
source scripts/lib.sh
commit_and_push_if_changed "$PIPELINE_LOCK_FILE_RELATIVE" "$PIPELINE_LOCK_FILE_RELATIVE"
paths=("$PIPELINE_LOCK_FILE_RELATIVE")
commit_and_push_if_changed "$PIPELINE_LOCK_FILE_RELATIVE" "$paths"
- name: Commit and push changes in eo-phi-normalizer data files
if: always() && env.branch_is_not_master && runner.os == 'Linux'
run: |
source scripts/lib.sh
data_directory="$PIPELINE_EO_PHI_NORMALIZER_DATA_DIR"
commit_and_push_if_changed "$data_directory" "eo-phi-normalizer data files"
paths=("$PIPELINE_EO_PHI_NORMALIZER_DATA_DIR")
commit_and_push_if_changed "eo-phi-normalizer data files" "$paths"
- name: Install mdsh
if: env.branch_is_not_master && runner.os == 'Linux'
Expand All @@ -296,8 +297,8 @@ jobs:
if: env.branch_is_not_master && runner.os == 'Linux'
run: |
source scripts/lib.sh
files=('site' 'proposals' 'README.md' 'CONTRIBUTING.md')
commit_and_push_if_changed "$files" "Markdown files"
paths=('site' 'proposals' 'README.md' 'CONTRIBUTING.md')
commit_and_push_if_changed "Markdown files" "$paths"
- name: Create a directory for docs
if: runner.os == 'Linux'
Expand Down
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
*.bak
eo-phi-normalizer/src/Language/EO/Phi/Syntax/Lex.hs
eo-phi-normalizer/src/Language/EO/Phi/Syntax/Par.hs
eo-phi-normalizer/src/Language/EO/Phi/Syntax/ErrM.hs
eo-phi-normalizer/src/Language/EO/Phi/Syntax/Skel.hs
eo-phi-normalizer/src/Language/EO/Phi/Syntax/Test.hs
eo-phi-normalizer/src/Language/EO/Phi/Syntax/Test
eo-phi-normalizer/src/Language/EO/Phi/Syntax/Par.info
.cache/
.DS_Store
dist
Expand Down Expand Up @@ -49,3 +46,4 @@ pipeline/*
node_modules

try-unphi
tmp
2 changes: 1 addition & 1 deletion eo
Submodule eo updated 907 files
4 changes: 2 additions & 2 deletions eo-phi-normalizer/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ main =
, "bnfc --haskell -d -p Language.EO.Phi --generic -o src/ grammar/EO/Phi/Syntax.cf"
, "cd src/Language/EO/Phi/Syntax"
, "alex Lex.x"
, "happy Par.y"
, "happy --info Par.y"
, "rm -f Print.hs ErrM.hs Skel.hs Test.hs Abs.hs.bak Print.hs.bak"
, "true"
]

Expand All @@ -99,7 +100,6 @@ main =

_ <- callCommand fullCommand
_ <- addLicense "Abs.hs"
_ <- addLicense "Print.hs"

postConf simpleUserHooks args flags packageDesc localBuildInfo
}
Expand Down
29 changes: 23 additions & 6 deletions eo-phi-normalizer/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ import Language.EO.Phi.Pipeline.Dataize.PrintConfigs as PrintConfigs
import Language.EO.Phi.Pipeline.EOTests.PrepareTests as PrepareTests
import Language.EO.Phi.Report.Data (makeProgramReport, makeReport)
import Language.EO.Phi.Report.Html (reportCSS, reportJS, toStringReport)
import Language.EO.Phi.Rules.Common
import Language.EO.Phi.Rules.Common (ApplicationLimits (ApplicationLimits), Context (..), LogEntry (..), applyRulesChainWith', applyRulesWith, objectSize)
import Language.EO.Phi.Rules.Fast (fastYegorInsideOut, fastYegorInsideOutAsRule)
import Language.EO.Phi.Rules.RunYegor (yegorRuleSet)
import Language.EO.Phi.Rules.Yaml (RuleSet (rules, title), convertRuleNamed, parseRuleSetFromFile)
import Language.EO.Phi.Syntax (desugar, wrapBytesInBytes, wrapTermination)
import Language.EO.Phi.Syntax (desugar, errorExpectedDesugaredObject, wrapBytesInBytes, wrapTermination)
import Language.EO.Phi.ToLaTeX
import Language.EO.Test.YamlSpec (spec)
import Options.Applicative hiding (metavar)
Expand Down Expand Up @@ -275,6 +275,9 @@ data CommandParser = CommandParser
, test :: Parser CLI'Test
}

rulesFile :: String
rulesFile = "yegor.yaml"

commandParser :: CommandParser
commandParser =
CommandParser{..}
Expand All @@ -285,7 +288,7 @@ commandParser =
bindingsPath <- bindingsPathOption
pure CLI'MetricsPhi{..}
printRules = do
rulesPath <- optional $ strOption (long "rules" <> short 'r' <> metavar.file <> help [fmt|{metavarName.file} with user-defined rules. If unspecified, yegor.yaml is rendered.|])
rulesPath <- optional $ strOption (long "rules" <> short 'r' <> metavar.file <> help [fmt|{metavarName.file} with user-defined rules. If unspecified, {rulesFile} is rendered.|])
latex <- latexSwitch
compact <- compactSwitch
pure CLI'PrintRules{..}
Expand Down Expand Up @@ -556,17 +559,21 @@ wrapRawBytesIn = \case
]
ObjectDispatch obj a ->
ObjectDispatch (wrapRawBytesIn obj) a
GlobalObject -> GlobalObject
ThisObject -> ThisObject
Termination -> wrapTermination
obj@GlobalObject -> obj
obj@GlobalObjectPhiOrg -> obj
obj@ThisObject -> obj
obj@MetaSubstThis{} -> obj
obj@MetaContextualize{} -> obj
obj@MetaObject{} -> obj
obj@MetaTailContext{} -> obj
obj@MetaFunction{} -> obj
obj@ConstString{} -> wrapRawBytesIn (desugar obj)
obj@ConstStringRaw{} -> errorExpectedDesugaredObject obj
obj@ConstInt{} -> wrapRawBytesIn (desugar obj)
obj@ConstIntRaw{} -> errorExpectedDesugaredObject obj
obj@ConstFloat{} -> wrapRawBytesIn (desugar obj)
obj@ConstFloatRaw{} -> errorExpectedDesugaredObject obj

-- * Main

Expand Down Expand Up @@ -600,7 +607,7 @@ main = withCorrectLocale do
-- Temporary hack while rules are not stabilized.
-- Nothing -> return (True, "Yegor's rules (builtin)", [fastYegorInsideOutAsRule])
Nothing -> do
ruleSet :: RuleSet <- decodeThrow $(embedFileRelative "test/eo/phi/rules/new.yaml")
ruleSet :: RuleSet <- decodeThrow $(embedFileRelative "test/eo/phi/rules/yegor.yaml")
return (False, ruleSet.title, convertRuleNamed <$> ruleSet.rules)
unless (single || json || latex) $ logStrLn ruleSetTitle
bindingsWithDeps <- case deepMergePrograms (program' : deps) of
Expand Down Expand Up @@ -696,6 +703,16 @@ main = withCorrectLocale do
bindingsWithDeps <- case deepMergePrograms (program' : deps) of
Left err -> throwIO (CouldNotMergeDependencies err)
Right (Program bindingsWithDeps) -> return bindingsWithDeps
-- (builtin, ruleSetTitle, rules) <-
-- case rulesPath of
-- Just path -> do
-- ruleSet <- parseRuleSetFromFile path
-- return (False, ruleSet.title, convertRuleNamed <$> ruleSet.rules)
-- -- Temporary hack while rules are not stabilized.
-- -- Nothing -> return (True, "Yegor's rules (builtin)", [fastYegorInsideOutAsRule])
-- Nothing -> do
-- ruleSet :: RuleSet <- decodeThrow $(embedFileRelative "test/eo/phi/rules/new.yaml")
-- return (False, ruleSet.title, convertRuleNamed <$> ruleSet.rules)
(builtin, _ruleSetTitle, rules) <-
case rulesPath of
Just path -> do
Expand Down
Loading

0 comments on commit 18a461c

Please sign in to comment.