Skip to content

Commit

Permalink
Merge pull request #854 from melt-umn/develop
Browse files Browse the repository at this point in the history
Silver 0.5.1 release candidate
  • Loading branch information
krame505 authored Oct 22, 2024
2 parents 7a38df9 + cca1f41 commit 9229e9f
Show file tree
Hide file tree
Showing 368 changed files with 10,255 additions and 10,662 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ melt.trynode('silver') {
// Projects with 'develop' as main branch, we'll try to build specific branch names if they exist
def github_projects = ["/melt-umn/ableC", "/melt-umn/Oberon0", "/melt-umn/meta-ocaml-lite",
"/melt-umn/lambda-calculus", "/melt-umn/rewriting-regex-matching", "/melt-umn/rewriting-optimization-demo",
"/melt-umn/caml-light"]
"/melt-umn/caml-light", "/melt-umn/tree-sharing-demo"]
// These are not currently maintened: "/internal/ring"
// Specific other jobs to build
def specific_jobs = ["/internal/matlab/master"]
Expand Down
24 changes: 20 additions & 4 deletions fetch-jars
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

set -eu

# Usage: ./fetch-jars [rev-name] [--unstable] [--copper]
# Usage: ./fetch-jars [rev-name] [--unstable] [--local] [--copper]
# If a revision is not specified, the script fetches the latest jars from the current branch,
# falling back to develop.
# If --unstable is specified, always fetch from commit artifacts on foundry.
# If --local is specified, only fetch jars from the local cache.
# If --copper is specified, only fetch the Copper jars.

# Parse command line argumants.
Expand All @@ -20,8 +21,13 @@ done

COMMIT_ARTIFACTS="https://foundry.remexre.xyz/commit-artifacts/"

args=$*
function has_jars {
wget --spider -q "$COMMIT_ARTIFACTS/$1"
if [[ $args == *--local* ]]; then
[[ -d "JARS-BAK/$1" ]]
else
wget --spider -q "$COMMIT_ARTIFACTS/$1"
fi
}

rev=""
Expand All @@ -34,7 +40,7 @@ fi
# Get the hash of the latest commit on develop.
# This always gives the latest commit regardless of if the repo is up to date,
# and works in a Jenkins checkout.
DEVELOP=$(git ls-remote https://github.com/melt-umn/silver develop | cut -f1)
DEVELOP=$(git ls-remote https://github.com/melt-umn/silver develop | cut -f1 | head -n1)

# Look for jars in the current commit and its parents.
# First, check that we are inside a git repo.
Expand All @@ -52,7 +58,17 @@ if [[ -z $rev ]] && git rev-parse --is-inside-work-tree 1> /dev/null 2> /dev/nul
fi

# Figure out how to obtain the jars from the revision we chose.
if [[ $* != *--unstable* && (-z $rev || $rev == "$DEVELOP") ]]; then
if [[ $* == *--local* ]]; then
if [[ -z $rev ]]; then
echo "Failed to find local jars for the specified revision."
exit 1
fi

echo "Fetching local jars..."
LOCAL_STORE="JARS-BAK/$rev"
REMOTE_STORE=
JARS_BAK=
elif [[ $* != *--unstable* && $* != *--local* && (-z $rev || $rev == "$DEVELOP") ]]; then
echo "Fetching latest stable jars..."
LOCAL_STORE=/web/research/melt.cs.umn.edu/downloads/silver-dev/jars
REMOTE_STORE="https://melt.cs.umn.edu/downloads/silver-dev/jars"
Expand Down
31 changes: 18 additions & 13 deletions grammars/silver/compiler/analysis/typechecking/core/AspectDcl.sv
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ top::AGDcl ::= 'aspect' 'production' id::QName ns::AspectProductionSignature bod
{
local attribute errCheck1 :: TypeCheck; errCheck1.finalSubst = ns.finalSubst;

errCheck1 = check(realSig.typeScheme.typerep, namedSig.typeScheme.typerep);
errCheck1 = check(realSig.dclTypeScheme.typerep, namedSig.dclTypeScheme.typerep);
top.errors <-
if errCheck1.typeerror
then [err(top.location, "Aspect for '" ++ id.name ++ "' does not have the right signature.\nExpected: "
then [errFromOrigin(top, "Aspect for '" ++ id.name ++ "' does not have the right signature.\nExpected: "
++ errCheck1.leftpp ++ "\nActual: " ++ errCheck1.rightpp)]
else
-- dcl is potentially not found, accessing it can crash.
-- so check on dcls for this.
case id.lookupValue.dcls of
| prodDcl (_, _) :: _ -> []
| funDcl (_) :: _ -> [err(top.location, "Production aspect for '" ++ id.name ++ "' should be a 'function' aspect instead.")]
| _ -> [err(id.location, id.name ++ " is not a production.")]
| prodDcl (_, _, _) :: _ -> []
| funDcl (_) :: _ -> [errFromOrigin(top, "Production aspect for '" ++ id.name ++ "' should be a 'function' aspect instead.")]
| _ -> [errFromOrigin(id, id.name ++ " is not a production.")]
end;

ns.downSubst = emptySubst();
Expand All @@ -34,17 +34,17 @@ top::AGDcl ::= 'aspect' 'function' id::QName ns::AspectFunctionSignature body::P
{
local attribute errCheck1 :: TypeCheck; errCheck1.finalSubst = ns.finalSubst;

errCheck1 = check(realSig.typeScheme.typerep, namedSig.typeScheme.typerep);
errCheck1 = check(realSig.dclTypeScheme.typerep, namedSig.dclTypeScheme.typerep);
top.errors <-
if errCheck1.typeerror
then [err(top.location, "Aspect for '" ++ id.name ++ "' does not have the right signature.\nExpected: "
then [errFromOrigin(top, "Aspect for '" ++ id.name ++ "' does not have the right signature.\nExpected: "
++ errCheck1.leftpp ++ "\nActual: " ++ errCheck1.rightpp)]
else
-- must be on dcls because lookup may have failed.
case id.lookupValue.dcls of
| funDcl (_) :: _ -> []
| prodDcl (_, _) :: _ -> [err(top.location, "Function aspect for '" ++ id.name ++ "' should be a 'production' aspect instead.")]
| _ -> [err(id.location, id.name ++ " is not a function.")]
| prodDcl (_, _, _) :: _ -> [errFromOrigin(top, "Function aspect for '" ++ id.name ++ "' should be a 'production' aspect instead.")]
| _ -> [errFromOrigin(id, id.name ++ " is not a function.")]
end;

ns.downSubst = emptySubst();
Expand All @@ -71,7 +71,7 @@ top::AspectProductionLHS ::= id::Name t::Type
errCheck1 = check(rType, t);
top.errors <-
if errCheck1.typeerror
then [err(top.location, "Type incorrect in aspect signature. Expected: " ++ errCheck1.leftpp ++ " Got: " ++ errCheck1.rightpp)]
then [errFromOrigin(top, "Type incorrect in aspect signature. Expected: " ++ errCheck1.leftpp ++ " Got: " ++ errCheck1.rightpp)]
else [];
}

Expand All @@ -88,7 +88,7 @@ top::AspectRHS ::= h::AspectRHSElem t::AspectRHS
}

aspect production aspectRHSElemFull
top::AspectRHSElem ::= id::Name t::Type
top::AspectRHSElem ::= shared::Boolean id::Name t::Type
{
local attribute errCheck1 :: TypeCheck; errCheck1.finalSubst = top.finalSubst;

Expand All @@ -97,8 +97,13 @@ top::AspectRHSElem ::= id::Name t::Type
errCheck1 = check(rType, t);
top.errors <-
if errCheck1.typeerror
then [err(top.location, "Type incorrect in aspect signature. Expected: " ++ errCheck1.leftpp ++ " Got: " ++ errCheck1.rightpp)]
then [errFromOrigin(top, "Type incorrect in aspect signature. Expected: " ++ errCheck1.leftpp ++ " Got: " ++ errCheck1.rightpp)]
else [];

top.errors <-
if !null(top.realSignature) && head(top.realSignature).elementShared != shared
then [errFromOrigin(top, "Sharedness incorrect in aspect signature.")]
else [];
}

aspect production aspectFunctionSignature
Expand All @@ -117,7 +122,7 @@ top::AspectFunctionLHS ::= t::TypeExpr
errCheck1 = check(rType, t.typerep);
top.errors <-
if errCheck1.typeerror
then [err(top.location, "Type incorrect in aspect signature. Expected: " ++ errCheck1.leftpp ++ " Got: " ++ errCheck1.rightpp)]
then [errFromOrigin(top, "Type incorrect in aspect signature. Expected: " ++ errCheck1.leftpp ++ " Got: " ++ errCheck1.rightpp)]
else [];
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ top::ClassBodyItem ::= id::Name '::' cl::ConstraintList '=>' ty::TypeExpr '=' e:
local errCheck1::TypeCheck = check(ty.typerep, e.typerep);
top.errors <-
if errCheck1.typeerror
then [err(e.location, s"Member ${id.name} has expected type ${errCheck1.leftpp}, but the expression has actual type ${errCheck1.rightpp}")]
then [errFromOrigin(e, s"Member ${id.name} has expected type ${errCheck1.leftpp}, but the expression has actual type ${errCheck1.rightpp}")]
else [];

e.downSubst = emptySubst();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ top::Context ::= attr::String args::[Type] atty::Type ntty::Type
-- atty should never have free type variables if ntty does not, except in case of errors elsewhere.
else {-if !null(atty.freeFlexibleVars)
then error(s"got atty with free vars")
else-} if null(top.resolvedOccurs)
else-} if ntty.isDecorated
then [err(top.contextLoc, s"Could not find an instance for ${prettyContext(top)}; an undecorated type is expected here (arising from ${top.contextSource})")]
else if null(top.resolvedOccurs)
then [err(top.contextLoc, s"Could not find an instance for ${prettyContext(top)} (arising from ${top.contextSource})")]
else requiredContexts.contextErrors;

Expand Down
Loading

0 comments on commit 9229e9f

Please sign in to comment.