types.ts 298 B

123456789101112131415
  1. export interface Literal {
  2. type: "literal";
  3. value: number;
  4. }
  5. export type BinaryOperators = "+" | "-" | "*" | "/";
  6. export interface BinaryOperation {
  7. type: "binary";
  8. operator: BinaryOperators;
  9. left: Expression;
  10. right: Expression;
  11. }
  12. export type Expression = Literal | BinaryOperation;