You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sem symLookupError lkup =| ident ->
errorSingle lkup.info
(join ["Unknown ", lkup.kind, " in symbolize: ", nameGetStr ident])
This makes it impossible to provide language support, since the compiler crashes when typing the language fragment. A better solution would be to change the symbolizeExpr signature to something like this:
syn SymbolizeError =
| UnknownLanguageError String
| OtherError String
sem symbolizeExpr : SymEnv -> Expr -> Result [(Info, SymbolizeWarning)] [(Info, SymbolizeError)] Expr
And then changing all symbolizeExpr to use results, e.g.:
lang LetSym = Sym + LetAst + AllTypeAst
sem symbolizeExpr (env : SymEnv) =
| TmLet t ->
match symbolizeTyAnnot env t.tyAnnot with (tyVarEnv, tyAnnot) in
match setSymbol env.currentEnv.varEnv t.ident with (varEnv, ident) in
let body = symbolizeExpr (symbolizeUpdateTyVarEnv env tyVarEnv) t.body in
let inexpr = symbolizeExpr (symbolizeUpdateVarEnv env varEnv) t.inexpr in
result.map2 (
lam body. lam inexpr.
TmLet {t with ident = ident,
tyAnnot = tyAnnot,
body = body,
inexpr = inexpr}
) body inexpr
The text was updated successfully, but these errors were encountered:
Example:
Unknown language in symbolize: MLangAst
Caused by (
stdlib/mexpr/symbolize.mc
):This makes it impossible to provide language support, since the compiler crashes when typing the language fragment. A better solution would be to change the
symbolizeExpr
signature to something like this:And then changing all
symbolizeExpr
to use results, e.g.:The text was updated successfully, but these errors were encountered: