Skip to content

permit use of keywords in javascript expressions #208

@trebor

Description

@trebor

currently, there are valid javascript expressions that use observables keywords mutable and viewof as identifiers that the observable parser will reject. the goal would be to allow these expressions where possible.

here are some examples of these identifiers that could be defined in a local cell scope:

{
  const viewof = 3;
}
function foo(viewof) { ... }

and at the notebook scope where cells can be named mutable and viewof:

function viewof() { ... }
viewof = 3

additionally, import semantics need to be worked out. what happens if a cell named viewof is imported from another notebook that defines it as a cell:

import { viewof } from "..."

this change is likely to alter logic in parse.js, and the Hello, Observable Parser notebook can be used to aid in testing.

broadly this change would be a preamble to possibly adding a builtin keyword to provide a namespace for all the built-in identifiers like width.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions