Skip to content

Commit

Permalink
refactor: remove unneeded dimenions property from query statement type
Browse files Browse the repository at this point in the history
Also, update types needed for scatter plot and parser rule for scatter plot query statement
  • Loading branch information
mgreminger committed Oct 26, 2023
1 parent 7d945aa commit 3bde584
Show file tree
Hide file tree
Showing 5 changed files with 734 additions and 678 deletions.
5 changes: 4 additions & 1 deletion public/dimensional_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ class BaseQueryStatement(QueryAssignmentCommon):
isFromPlotCell: bool
units: str
unitsLatex: str
dimensions: list[float]

class QueryStatement(BaseQueryStatement):
isRange: Literal[False]
Expand Down Expand Up @@ -323,6 +322,10 @@ class ScatterQueryStatement(BaseQueryStatement):
cellNum: int
xValuesQuery: ScatterXValuesQueryStatement
yValuesQuery: ScatterYValuesQueryStatement
xName: str
yName: str
inputUnits: str
inputUnitsLatex: str

class CodeFunctionRawQuery(BaseQueryStatement):
isRange: Literal[False]
Expand Down
2 changes: 1 addition & 1 deletion src/parser/LatexParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ statement: (assign | assign_list | assign_plus_query | query | equality |
u_block | number | id | id_list | guess | guess_list | expr |
condition | piecewise_assign | insert_matrix | scatter_plot_query)? EOF;

scatter_plot_query: ( L_PAREN expr COMMA expr R_PAREN ) | ( expr COMMA expr ) EQ ;
scatter_plot_query: ( L_PAREN id COMMA id R_PAREN ) | ( id COMMA id ) EQ (( L_PAREN u_block COMMA u_block R_PAREN ) | ( u_block COMMA u_block ))?;

insert_matrix: .*? (u_insert_matrix .*?)+;

Expand Down
Loading

0 comments on commit 3bde584

Please sign in to comment.