pine-parser 0.2.1

Parser for Pine Script.
Documentation
[
  {
    "VarDecl": {
      "name": "result",
      "type_annotation": null,
      "initializer": {
        "Switch": {
          "value": {
            "Variable": {
              "name": "x"
            }
          },
          "cases": [
            [
              {
                "Literal": {
                  "Int": 1
                }
              },
              {
                "Literal": {
                  "String": "one"
                }
              }
            ],
            [
              {
                "Literal": {
                  "Int": 2
                }
              },
              {
                "Literal": {
                  "String": "two"
                }
              }
            ],
            [
              {
                "Literal": {
                  "Int": 3
                }
              },
              {
                "Literal": {
                  "String": "three"
                }
              }
            ]
          ]
        }
      }
    }
  },
  {
    "VarDecl": {
      "name": "color",
      "type_annotation": null,
      "initializer": {
        "Switch": {
          "value": {
            "Variable": {
              "name": "mode"
            }
          },
          "cases": [
            [
              {
                "Literal": {
                  "String": "red"
                }
              },
              {
                "Literal": {
                  "HexColor": "#FF0000"
                }
              }
            ],
            [
              {
                "Literal": {
                  "String": "green"
                }
              },
              {
                "Literal": {
                  "HexColor": "#00FF00"
                }
              }
            ],
            [
              {
                "Literal": {
                  "String": "blue"
                }
              },
              {
                "Literal": {
                  "HexColor": "#0000FF"
                }
              }
            ]
          ]
        }
      }
    }
  }
]