expr

Types

ExprKind = enum
  ekAll, ekAny, ekLast, ekLastN, ekHash, ekNum, ekStep, ekRange, ekSeq, ekIndex, ekNearest
Expr = ref object
  case kind*: ExprKind
  of ekNum:
      num*: int

  of ekStep:
      stepExpr*: Expr
      step*: int

  of ekRange:
      rangeSlice*: Slice[int]

  of ekSeq:
      exprs*: seq[Expr]

  of ekIndex:
      indexer*: int
      index*: int

  of ekNearest:
      nearest: int

  of ekLastN:
      last*: int

  else:
      nil

  

Procs

proc newAllExpr(): Expr {...}{.raises: [], tags: [].}
proc newAnyExpr(): Expr {...}{.raises: [], tags: [].}
proc newLastExpr(): Expr {...}{.raises: [], tags: [].}
proc newHashExpr(): Expr {...}{.raises: [], tags: [].}
proc newNumExpr(num: int): Expr {...}{.raises: [], tags: [].}
proc newStepExpr(expr: Expr; step: int): Expr {...}{.raises: [], tags: [].}
proc newRangeExpr(start: int; stop: int): Expr {...}{.raises: [], tags: [].}
proc newSeqExpr(exprs: seq[Expr]): Expr {...}{.raises: [], tags: [].}
proc newIndexExpr(indexer: int; index: int): Expr {...}{.raises: [], tags: [].}
proc newNearestExpr(nearest: int): Expr {...}{.raises: [], tags: [].}
proc newLastNExpr(last: int): Expr {...}{.raises: [], tags: [].}
proc `$`(expr: Expr): string {...}{.raises: [ValueError, Exception], tags: [RootEffect].}