Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

permit use of keywords in javascript expressions #208

Open
trebor opened this issue Apr 5, 2023 · 0 comments
Open

permit use of keywords in javascript expressions #208

trebor opened this issue Apr 5, 2023 · 0 comments

Comments

@trebor
Copy link

trebor commented Apr 5, 2023

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.

@trebor trebor self-assigned this Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant