mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
Semantic highlighting of variables
This commit is contained in:
parent
30b14a2e1a
commit
480275e3a7
@ -4,6 +4,7 @@ import edu.kit.typicalc.model.parser.LambdaParser;
|
|||||||
import edu.kit.typicalc.model.parser.ParseError;
|
import edu.kit.typicalc.model.parser.ParseError;
|
||||||
import edu.kit.typicalc.model.parser.TypeAssumptionParser;
|
import edu.kit.typicalc.model.parser.TypeAssumptionParser;
|
||||||
import edu.kit.typicalc.model.term.LambdaTerm;
|
import edu.kit.typicalc.model.term.LambdaTerm;
|
||||||
|
import edu.kit.typicalc.model.term.ScopingVisitor;
|
||||||
import edu.kit.typicalc.model.term.VarTerm;
|
import edu.kit.typicalc.model.term.VarTerm;
|
||||||
import edu.kit.typicalc.model.type.TypeAbstraction;
|
import edu.kit.typicalc.model.type.TypeAbstraction;
|
||||||
import edu.kit.typicalc.util.Result;
|
import edu.kit.typicalc.util.Result;
|
||||||
@ -39,8 +40,10 @@ public class ModelImpl implements Model {
|
|||||||
if (assumptionMap.isError()) {
|
if (assumptionMap.isError()) {
|
||||||
return new Result<>(null, assumptionMap.unwrapError());
|
return new Result<>(null, assumptionMap.unwrapError());
|
||||||
}
|
}
|
||||||
//Create and return TypeInferer
|
// scope variables
|
||||||
TypeInferer typeInferer = new TypeInferer(result.unwrap(), assumptionMap.unwrap());
|
LambdaTerm term = result.unwrap();
|
||||||
|
term.accept(new ScopingVisitor());
|
||||||
|
TypeInferer typeInferer = new TypeInferer(term, assumptionMap.unwrap());
|
||||||
return new Result<>(typeInferer, null);
|
return new Result<>(typeInferer, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,6 +82,8 @@ public class LatexCreatorTerm implements TermVisitor {
|
|||||||
if (mode == LatexCreatorMode.MATHJAX) {
|
if (mode == LatexCreatorMode.MATHJAX) {
|
||||||
latex.append("\\class{typicalc-type typicalc-type-v-");
|
latex.append("\\class{typicalc-type typicalc-type-v-");
|
||||||
latex.append(varTerm.hashCode());
|
latex.append(varTerm.hashCode());
|
||||||
|
latex.append("-");
|
||||||
|
latex.append(varTerm.uniqueIndex());
|
||||||
latex.append("}{");
|
latex.append("}{");
|
||||||
}
|
}
|
||||||
latex.append(MONO_TEXT);
|
latex.append(MONO_TEXT);
|
||||||
|
Loading…
Reference in New Issue
Block a user