Skip to content

Commit f695378

Browse files
committed
update docs
1 parent 615416a commit f695378

File tree

4 files changed

+270
-7
lines changed

4 files changed

+270
-7
lines changed

assets/R_syntax.d.ts

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
declare namespace Token {
2+
type tokenType = "undefined" | "number" | "character" | "logical" | "factor" | "keyword" | "symbol" | "operator" | "comment" | "newLine" | "whitespace" | "bracket" | "terminator" | "color" | "delimiter";
3+
/**
4+
* regexp for test html colors
5+
*/
6+
const html_color: RegExp;
7+
/**
8+
* pattern for match the number token
9+
*/
10+
const number_regexp: RegExp;
11+
const symbol_name: RegExp;
12+
interface token {
13+
text: string;
14+
type: tokenType;
15+
}
16+
const logical: {};
17+
const operators: {};
18+
const stacks: {};
19+
const keywords: {};
20+
function isColorLiteral(pull_str: string): boolean;
21+
}
22+
declare class TokenParser {
23+
source: string;
24+
escaped: boolean;
25+
escape_char: string | null;
26+
escape_comment: boolean;
27+
/**
28+
* for get char at index
29+
*/
30+
i: number;
31+
str_len: number;
32+
/**
33+
* the token text buffer
34+
*/
35+
buf: string[];
36+
constructor(source: string);
37+
getTokens(): token[];
38+
private walkChar;
39+
private measureToken;
40+
}
41+
type token = Token.token;
42+
declare function parseText(str: string): token[];
43+
/**
44+
* parse the script text to syntax highlight html content
45+
*/
46+
declare function highlights(str: string, verbose?: boolean): string;
47+
declare function escape_op(str: string): string;

assets/R_syntax.js

+175-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/_assets/R_syntax.d.ts

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
declare namespace Token {
2+
type tokenType = "undefined" | "number" | "character" | "logical" | "factor" | "keyword" | "symbol" | "operator" | "comment" | "newLine" | "whitespace" | "bracket" | "terminator" | "color" | "delimiter";
3+
/**
4+
* regexp for test html colors
5+
*/
6+
const html_color: RegExp;
7+
/**
8+
* pattern for match the number token
9+
*/
10+
const number_regexp: RegExp;
11+
const symbol_name: RegExp;
12+
interface token {
13+
text: string;
14+
type: tokenType;
15+
}
16+
const logical: {};
17+
const operators: {};
18+
const stacks: {};
19+
const keywords: {};
20+
function isColorLiteral(pull_str: string): boolean;
21+
}
22+
declare class TokenParser {
23+
source: string;
24+
escaped: boolean;
25+
escape_char: string | null;
26+
escape_comment: boolean;
27+
/**
28+
* for get char at index
29+
*/
30+
i: number;
31+
str_len: number;
32+
/**
33+
* the token text buffer
34+
*/
35+
buf: string[];
36+
constructor(source: string);
37+
getTokens(): token[];
38+
private walkChar;
39+
private measureToken;
40+
}
41+
type token = Token.token;
42+
declare function parseText(str: string): token[];
43+
/**
44+
* parse the script text to syntax highlight html content
45+
*/
46+
declare function highlights(str: string, verbose?: boolean): string;
47+
declare function escape_op(str: string): string;

vignettes/_assets/R_syntax.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)