pine-parser 0.1.0

Parser for Pine Script.
Documentation
[
  {
    "VarDecl": {
      "name": "x",
      "type_annotation": null,
      "initializer": {
        "Literal": {
          "Int": 10
        }
      }
    }
  },
  {
    "VarDecl": {
      "name": "y",
      "type_annotation": null,
      "initializer": {
        "Literal": {
          "Int": 5
        }
      }
    }
  },
  {
    "If": {
      "condition": {
        "Binary": {
          "left": {
            "Variable": "x"
          },
          "op": "Greater",
          "right": {
            "Variable": "y"
          }
        }
      },
      "then_branch": [
        {
          "VarDecl": {
            "name": "z",
            "type_annotation": null,
            "initializer": {
              "Literal": {
                "Int": 1
              }
            }
          }
        },
        {
          "If": {
            "condition": {
              "Binary": {
                "left": {
                  "Variable": "x"
                },
                "op": "Eq",
                "right": {
                  "Literal": {
                    "Int": 10
                  }
                }
              }
            },
            "then_branch": [
              {
                "VarDecl": {
                  "name": "a",
                  "type_annotation": null,
                  "initializer": {
                    "Literal": {
                      "Int": 100
                    }
                  }
                }
              }
            ],
            "else_if_branches": [],
            "else_branch": [
              {
                "VarDecl": {
                  "name": "a",
                  "type_annotation": null,
                  "initializer": {
                    "Literal": {
                      "Int": 200
                    }
                  }
                }
              }
            ]
          }
        }
      ],
      "else_if_branches": [],
      "else_branch": null
    }
  }
]