Public
Edited
Mar 3, 2023
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// Place to edit the (BuildOptions.externalTokenizer)[https://lezer.codemirror.net/docs/ref/#generator.BuildOptions.externalTokenizer] option if you need to
EXTERNAL_TOKENIZER = (name, terms) => {
const CHAR_SPACE = " ".codePointAt(0);
const CHAR_DOT = ".".codePointAt(0);
const CHAR_STAR = "*".codePointAt(0);
const CHAR_LBRACKET = "{".codePointAt(0);

return new ExternalTokenizer(
(input, stack) => {
// nowhitespace
if (
(input.peek(-1) === CHAR_SPACE || input.peek(0) === CHAR_SPACE) &&
stack.canShift(terms.whitespace)
) {
input.acceptToken(terms.whitespace, 0);
return;
}
},
{ extend: true }
);
}
Insert cell
Insert cell
Insert cell
mutable parse = parser.startParse(CODE)
Insert cell
first_stack = parse.stacks[0]
Insert cell
parser.termNames
Insert cell
s = stack_to_object(first_stack)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more