brimdata / zed

A novel data lake based on super-structured data
https://zed.brimdata.io/
BSD 3-Clause "New" or "Revised" License
1.34k stars 67 forks source link

Add positional information to AST Nodes #5108

Closed mattnibs closed 2 months ago

mattnibs commented 2 months ago

I should say this pr comes with a couple of loose ends that will need to be addressed in later work.

  1. Template literals are a hot mess and are going to have totally wrong positions. They need to have their own ast node instead of the hacked up solution we currently use.
  2. String positions are off- they currently refer to only the contents of the string and not the quotes. This will get resolved once we fix Template literals.
  3. Positional information for operator arguments / flags is not great and this lead me to have to do hacky stuff to get positions working for various operators that rely on them (e.g., load, file, get, pool). The big problem here is that each Op implements flags or optional args in its own way are there is no standardized ast.Node for flags that is used across all ops. We should do this.