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": 20
            }
          }
        }
      },
      "body": [
        {
          "Assignment": {
            "target": {
              "Variable": "i"
            },
            "value": {
              "Binary": {
                "left": {
                  "Variable": "i"
                },
                "op": "Add",
                "right": {
                  "Literal": {
                    "Int": 1
                  }
                }
              }
            }
          }
        },
        {
          "If": {
            "condition": {
              "Binary": {
                "left": {
                  "Variable": "i"
                },
                "op": "Greater",
                "right": {
                  "Literal": {
                    "Int": 10
                  }
                }
              }
            },
            "then_branch": [
              "Break"
            ],
            "else_if_branches": [],
            "else_branch": null
          }
        },
        {
          "If": {
            "condition": {
              "Binary": {
                "left": {
                  "Binary": {
                    "left": {
                      "Variable": "i"
                    },
                    "op": "Mod",
                    "right": {
                      "Literal": {
                        "Int": 2
                      }
                    }
                  }
                },
                "op": "Eq",
                "right": {
                  "Literal": {
                    "Int": 0
                  }
                }
              }
            },
            "then_branch": [
              "Continue"
            ],
            "else_if_branches": [],
            "else_branch": null
          }
        },
        {
          "Assignment": {
            "target": {
              "Variable": "sum"
            },
            "value": {
              "Binary": {
                "left": {
                  "Variable": "sum"
                },
                "op": "Add",
                "right": {
                  "Variable": "i"
                }
              }
            }
          }
        }
      ]
    }
  }
]