pine-parser 0.1.0

Parser for Pine Script.
Documentation
[
  {
    "VarDecl": {
      "name": "i",
      "type_annotation": null,
      "initializer": {
        "Literal": {
          "Int": 0
        }
      },
      "var_kind": "Var"
    }
  },
  {
    "VarDecl": {
      "name": "sum",
      "type_annotation": null,
      "initializer": {
        "Literal": {
          "Int": 0
        }
      },
      "var_kind": "Var"
    }
  },
  {
    "While": {
      "condition": {
        "Binary": {
          "left": {
            "Variable": "i"
          },
          "op": "Less",
          "right": {
            "Literal": {
              "Int": 3
            }
          }
        }
      },
      "body": [
        {
          "VarDecl": {
            "name": "j",
            "type_annotation": null,
            "initializer": {
              "Literal": {
                "Int": 0
              }
            },
            "var_kind": "Var"
          }
        },
        {
          "While": {
            "condition": {
              "Binary": {
                "left": {
                  "Variable": "j"
                },
                "op": "Less",
                "right": {
                  "Literal": {
                    "Int": 2
                  }
                }
              }
            },
            "body": [
              {
                "Assignment": {
                  "target": {
                    "Variable": "sum"
                  },
                  "value": {
                    "Binary": {
                      "left": {
                        "Variable": "sum"
                      },
                      "op": "Add",
                      "right": {
                        "Binary": {
                          "left": {
                            "Variable": "i"
                          },
                          "op": "Mul",
                          "right": {
                            "Variable": "j"
                          }
                        }
                      }
                    }
                  }
                }
              },
              {
                "Assignment": {
                  "target": {
                    "Variable": "j"
                  },
                  "value": {
                    "Binary": {
                      "left": {
                        "Variable": "j"
                      },
                      "op": "Add",
                      "right": {
                        "Literal": {
                          "Int": 1
                        }
                      }
                    }
                  }
                }
              }
            ]
          }
        },
        {
          "Assignment": {
            "target": {
              "Variable": "i"
            },
            "value": {
              "Binary": {
                "left": {
                  "Variable": "i"
                },
                "op": "Add",
                "right": {
                  "Literal": {
                    "Int": 1
                  }
                }
              }
            }
          }
        }
      ]
    }
  }
]