pine-parser 0.1.0

Parser for Pine Script.
Documentation
[
  {
    "VarDecl": {
      "name": "add",
      "type_annotation": null,
      "initializer": {
        "Function": {
          "params": [
            {
              "name": "a"
            },
            {
              "name": "b",
              "default_value": {
                "Literal": {
                  "Int": 10
                }
              }
            }
          ],
          "body": [
            {
              "Expression": {
                "Binary": {
                  "left": {
                    "Variable": "a"
                  },
                  "op": "Add",
                  "right": {
                    "Variable": "b"
                  }
                }
              }
            }
          ]
        }
      }
    }
  },
  {
    "VarDecl": {
      "name": "greet",
      "type_annotation": null,
      "initializer": {
        "Function": {
          "params": [
            {
              "name": "name"
            },
            {
              "name": "greeting",
              "default_value": {
                "Literal": {
                  "String": "Hello"
                }
              }
            },
            {
              "name": "punctuation",
              "default_value": {
                "Literal": {
                  "String": "!"
                }
              }
            }
          ],
          "body": [
            {
              "Expression": {
                "Binary": {
                  "left": {
                    "Binary": {
                      "left": {
                        "Binary": {
                          "left": {
                            "Variable": "greeting"
                          },
                          "op": "Add",
                          "right": {
                            "Literal": {
                              "String": " "
                            }
                          }
                        }
                      },
                      "op": "Add",
                      "right": {
                        "Variable": "name"
                      }
                    }
                  },
                  "op": "Add",
                  "right": {
                    "Variable": "punctuation"
                  }
                }
              }
            }
          ]
        }
      }
    }
  },
  {
    "VarDecl": {
      "name": "result",
      "type_annotation": null,
      "initializer": {
        "Call": {
          "callee": {
            "Variable": "add"
          },
          "args": [
            {
              "Positional": {
                "Literal": {
                  "Int": 5
                }
              }
            }
          ],
          "id": 1
        }
      }
    }
  },
  {
    "VarDecl": {
      "name": "msg",
      "type_annotation": null,
      "initializer": {
        "Call": {
          "callee": {
            "Variable": "greet"
          },
          "args": [
            {
              "Positional": {
                "Literal": {
                  "String": "World"
                }
              }
            }
          ],
          "id": 2
        }
      }
    }
  }
]