Expand description
This crate is part of the Goscript project. Please refer to https://goscript.dev for more information.
It’s a port of the the parser from the Go standard library https://github.com/golang/go/tree/release-branch.go1.12/src/go/parser
§Usage:
fn parse_file() {
    let source = "package main ...";
    let mut fs = go_parser::FileSet::new();
    let o = &mut go_parser::AstObjects::new();
    let el = &mut go_parser::ErrorList::new();
    let (p, _) = go_parser::parse_file(o, &mut fs, el, "./main.go", source, false);
    print!("{}", p.get_errors());
}§Feature
- btree_map: Make it use BTreeMap instead of HashMap
Modules§
Macros§
Structs§
- AssignStmt Key 
- AstObjects
- EntityKey 
- Error
- ErrorList 
- FieldKey 
- File
- FilePos
- FilePosErrors 
- FileSet
- FileSetIter 
- FuncDecl Key 
- FuncType Key 
- IdentKey 
- LabeledStmt Key 
- Parser
- PiggyVec 
- A vec that you can only insert into, so that the index can be used as a key
- PiggyVecIter 
- ScopeKey 
- SpecKey
- TokenData