pine-parser 0.2.2

Parser for Pine Script.
Documentation
[
  {
    "If": {
      "condition": {
        "Variable": {
          "name": "cond"
        }
      },
      "then_branch": [
        {
          "VarDecl": {
            "name": "v",
            "type_annotation": null,
            "initializer": {
              "Binary": {
                "left": {
                  "Binary": {
                    "left": {
                      "Variable": {
                        "name": "x"
                      }
                    },
                    "op": "Less",
                    "right": {
                      "Literal": {
                        "Int": 2
                      }
                    }
                  }
                },
                "op": "And",
                "right": {
                  "Variable": {
                    "name": "y"
                  }
                }
              }
            }
          }
        },
        {
          "VarDecl": {
            "name": "s",
            "type_annotation": null,
            "initializer": {
              "Ternary": {
                "condition": {
                  "Binary": {
                    "left": {
                      "Variable": {
                        "name": "a"
                      }
                    },
                    "op": "Greater",
                    "right": {
                      "Literal": {
                        "Int": 0
                      }
                    }
                  }
                },
                "then_expr": {
                  "Literal": {
                    "Int": 1
                  }
                },
                "else_expr": {
                  "Ternary": {
                    "condition": {
                      "Binary": {
                        "left": {
                          "Variable": {
                            "name": "b"
                          }
                        },
                        "op": "Less",
                        "right": {
                          "Literal": {
                            "Int": 0
                          }
                        }
                      }
                    },
                    "then_expr": {
                      "Literal": {
                        "Int": 2
                      }
                    },
                    "else_expr": {
                      "Literal": {
                        "Int": 3
                      }
                    }
                  }
                }
              }
            }
          }
        }
      ],
      "else_if_branches": [],
      "else_branch": null
    }
  },
  {
    "VarDecl": {
      "name": "q",
      "type_annotation": null,
      "initializer": {
        "Literal": {
          "Int": 1
        }
      }
    }
  }
]