Skip to content

EvolvingGS/CadenceParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CadenceParser

  • 保证Go版本大于1.18
go mod tidy
go run main.go

通过HTTP POST调用解析方法,例如:

# curl -X POST <ip>:8080/parse -d "pub contract FlowToken {}"
POST http://127.0.0.1:8080/parse HTTP/1.1</br>

pub contract FlowToken {}

Response:

HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Date: Mon, 31 Oct 2022 15:54:40 GMT
Content-Length: 428
Connection: close

{
  "program": {
    "Type": "Program",
    "Declarations": [
      {
        "Type": "CompositeDeclaration",
        "Access": "AccessPublic",
        "CompositeKind": "CompositeKindContract",
        "Identifier": {
          "Identifier": "FlowToken",
          "StartPos": {
            "Offset": 13,
            "Line": 1,
            "Column": 13
          },
          "EndPos": {
            "Offset": 21,
            "Line": 1,
            "Column": 21
          }
        },
        "Conformances": null,
        "Members": {
          "Declarations": null
        },
        "DocString": "",
        "StartPos": {
          "Offset": 0,
          "Line": 1,
          "Column": 0
        },
        "EndPos": {
          "Offset": 24,
          "Line": 1,
          "Column": 24
        }
      }
    ]
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors