You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

92 lines
2.0 KiB
TypeScript

import { Face } from "./colors.ts";
import { resolve, ref, Ouro } from "./ouro.ts";
export type Syn = Face | null;
export type BasicSyntax = {
comment: Syn,
documentaton: Syn,
string: Syn,
keyword: Syn,
operator: Syn,
constant: Syn,
function: Syn,
variable: Syn,
punctuation: Syn,
type: Syn,
label: Syn,
};
export const defaultBasicSyntax = {
comment: null,
documentaton: null,
string: null,
keyword: null,
operator: null,
constant: null,
function: null,
variable: null,
punctuation: null,
type: null,
label: null,
} as Ouro<BasicSyntax>;
export interface ExtendedSyntax {
tag: Syn,
number: Syn,
method: Syn,
methodCall: Syn,
functionCall: Syn,
property: Syn,
attribute: Syn,
constructor_: Syn,
punctuationSpecial: Syn,
punctuationBracket: Syn,
punctuationDelimiter: Syn,
super: Syn,
builtinType: Syn,
argumentType: Syn,
specialString: Syn,
macro: Syn,
typeParameter: Syn,
specialFunction: Syn,
specialVariable: Syn,
builtinConstant: Syn,
builtinFunction: Syn,
builtinVariable: Syn,
parameter: Syn,
propertyDefinition: Syn,
escape: Syn,
embedded: Syn,
}
export const defaultSyntax: Ouro<Syntax> = {
...defaultBasicSyntax,
tag: null,
number: ref("constant"),
functionCall: ref("function"),
method: ref("function"),
methodCall: ref("method"),
property: ref("variable"),
attribute: ref("property"),
constructor_: ref("type"),
punctuationSpecial: ref("punctuation"),
punctuationBracket: ref("punctuation"),
punctuationDelimiter: ref("punctuation"),
super: ref("keyword"),
builtinType: ref("type"),
builtinConstant: ref("constant"),
builtinFunction: ref("function"),
builtinVariable: ref("variable"),
argumentType: ref("type"),
embedded: null,
escape: null,
macro: ref("function"),
parameter: ref("variable"),
propertyDefinition: ref("variable"),
specialFunction: ref("function"),
specialString: ref("string"),
specialVariable: ref("variable"),
typeParameter: ref("type"),
};
export type Syntax = BasicSyntax & ExtendedSyntax;