pine-parser 0.2.2

Parser for Pine Script.
Documentation
[
  {
    "TypeDecl": {
      "name": "InfoLabel",
      "fields": [
        {
          "name": "x",
          "type_annotation": "int",
          "default_value": null
        },
        {
          "name": "y",
          "type_annotation": "int",
          "default_value": null
        }
      ]
    }
  },
  {
    "MethodDecl": {
      "name": "set",
      "params": [
        {
          "type_annotation": "InfoLabel",
          "name": "this",
          "default_value": null
        },
        {
          "type_annotation": "int",
          "name": "x",
          "default_value": {
            "Literal": "Na"
          }
        },
        {
          "type_annotation": "int",
          "name": "y",
          "default_value": {
            "Literal": "Na"
          }
        }
      ],
      "body": [
        {
          "If": {
            "condition": {
              "Unary": {
                "op": "Not",
                "expr": {
                  "Call": {
                    "callee": {
                      "Literal": "Na"
                    },
                    "args": [
                      {
                        "Positional": {
                          "Variable": {
                            "name": "x"
                          }
                        }
                      }
                    ],
                    "id": 1
                  }
                }
              }
            },
            "then_branch": [
              {
                "Assignment": {
                  "target": {
                    "MemberAccess": {
                      "object": {
                        "Variable": {
                          "name": "this"
                        }
                      },
                      "member": "x"
                    }
                  },
                  "value": {
                    "Variable": {
                      "name": "x"
                    }
                  }
                }
              }
            ],
            "else_if_branches": [],
            "else_branch": null
          }
        },
        {
          "If": {
            "condition": {
              "Unary": {
                "op": "Not",
                "expr": {
                  "Call": {
                    "callee": {
                      "Literal": "Na"
                    },
                    "args": [
                      {
                        "Positional": {
                          "Variable": {
                            "name": "y"
                          }
                        }
                      }
                    ],
                    "id": 2
                  }
                }
              }
            },
            "then_branch": [
              {
                "Assignment": {
                  "target": {
                    "MemberAccess": {
                      "object": {
                        "Variable": {
                          "name": "this"
                        }
                      },
                      "member": "y"
                    }
                  },
                  "value": {
                    "Variable": {
                      "name": "y"
                    }
                  }
                }
              }
            ],
            "else_if_branches": [],
            "else_branch": null
          }
        }
      ]
    }
  }
]