xval — Syntax Highlighting for xact
Syntax highlighting for the xact language (.xact, .xval files) — Xval's mathematical modeling language that mirrors computation logic in xlsx format.
Features
- Full syntax highlighting for xact scripts
- Keywords:
table, vtable, input, source, nrows, columns, type, distinct, vtables, params, name
- Built-in functions:
$sum, $year, $lookup, $if, $floor, $date, and all other $-prefixed functions
- Type annotations:
<int>, <float>, <string>, <date>, <bool>, including date informats like <date "%Y-%m-%d">
- Table references:
extract.POLNUM, summary.projection.age — table names are highlighted distinctly from column names
- Quoted column names:
extract."ISSUE AGE" and named identifiers like 'Is Qualified'n
- Row indices:
t, t0, t1, etc.
- Constants:
True, False, integers, and floats
- Comments: line (
//) and block (/* */)
- Bracket matching and auto-closing for
{}, [], (), and quote pairs
Installation
- Copy the
xval folder into your VS Code extensions directory:
- Windows:
%USERPROFILE%\.vscode\extensions\
- macOS/Linux:
~/.vscode/extensions/
- Restart VS Code.
- Open any
.xact or .xval file to see syntax highlighting.
Example
input extract {
type: "csv";
columns: {
POLNUM <string>;
ISSUE_DATE <date "%Y-%m-%d">;
'ISSUE AGE'n <int>;
}
}
table policy_metadata {
nrows: extract;
columns: {
issue_year <int>: $year(extract.ISSUE_DATE[t]);
issue_month <int>: $month(extract.ISSUE_DATE[t]);
}
}
vtable projection {
nrows: 24; // years
columns: {
age <int>: extract."ISSUE AGE"[t1] + t;
annual_mort <float>: $lookup(
mortality.PROBABILITY[:],
mortality.AGE[:] == self.age[t]
);
}
}
File Associations
| Extension |
Language |
.xact |
xact |
.xval |
xact |
| |