pine-parser 0.1.0

Parser for Pine Script.
Documentation
[
  {
    "VarDecl": {
      "name": "x",
      "type_annotation": null,
      "initializer": {
        "Ternary": {
          "condition": {
            "Binary": {
              "left": {
                "Variable": "close"
              },
              "op": "Greater",
              "right": {
                "Variable": "open"
              }
            }
          },
          "then_expr": {
            "Literal": {
              "Int": 1
            }
          },
          "else_expr": {
            "Literal": {
              "Int": 0
            }
          }
        }
      }
    }
  },
  {
    "VarDecl": {
      "name": "result",
      "type_annotation": null,
      "initializer": {
        "Ternary": {
          "condition": {
            "Binary": {
              "left": {
                "Variable": "close"
              },
              "op": "Greater",
              "right": {
                "Variable": "open"
              }
            }
          },
          "then_expr": {
            "Literal": {
              "Int": 1
            }
          },
          "else_expr": {
            "Ternary": {
              "condition": {
                "Binary": {
                  "left": {
                    "Variable": "close"
                  },
                  "op": "Less",
                  "right": {
                    "Variable": "open"
                  }
                }
              },
              "then_expr": {
                "Unary": {
                  "op": "Neg",
                  "expr": {
                    "Literal": {
                      "Int": 1
                    }
                  }
                }
              },
              "else_expr": {
                "Literal": {
                  "Int": 0
                }
              }
            }
          }
        }
      }
    }
  }
]