Skip to content

Document usage of JS parsers #77

@RayLuxembourg

Description

@RayLuxembourg

please provide an example so I could PR to add into readme.

discovered

func pareJSFile(path string) {
	jsStr, err := ioutil.ReadFile(path)
	if err != nil {
		fmt.Println(err)
		return
	}
	jsAst,err:= js.Parse(parse.NewInputBytes(jsStr))
	if err != nil {
		log.Fatal(err)
	}
	v:= Visitor{}
	js.Walk(v,jsAst)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions