LucianCumpata / K-VSCode

K language support for Visual Studio Code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

highlighting context rules

traiansf opened this issue · comments

Apparently the plugin is currently missing descriptions for contexts

Contexts are more or less like rules, but (1) they are introduced by context; (2) they have a special variable HOLE representing where evaluation should take place; and (3) the rewrite symbol => is usually missing, although it can sometimes be present.

I would like keyword context to be displayed using the same color as for rule and the HOLE to be specially marked with a different color.

Some context samples:

     context HOLE:AType typeStrict:: _ [result(CPPTypeExpr)]

or

     context HOLE:CPPTypeExpr typeStrict:: _
             requires notBool isDependentInScope(HOLE) [result(CPPType)]

or

     context (HOLE:Expr => reval(HOLE)) prval:: _ [result(PRVal)]

Thank you for the feedback! Should the name of variable HOLE have same colour?
ie context (HOLE:Expr => reval(HOLE)) prval:: _ [result(PRVal)]
"context" is coloured blue;
"HOLE" is coloured with a special colour;
should "Expr" be coloured with a special colour as well ?

EDIT: I updated the extension adding code highlighting for context and HOLE.
If the extension is not updating automatically in VSC, try ctrl+Shift+P and type Extensions: Check for Updates.

Thanks! I would say it's OK not to color the sort.