Exemple #1
0
func getImports(symbols *symbols.Symbols) (imports []*importType) {
	imports = make([]*importType, 0, len(symbols.ImportIdList))
	for _, id := range symbols.ImportIdList {
		impType := &importType{
			Id:      id,
			ExtFunc: symbols.ExternalFunction(id),
			Type:    symbols.Type(id),
		}
		imports = append(imports, impType)
	}
	return
}
Exemple #2
0
func getCharRanges(symbols *symbols.Symbols) (ranges []CharRange) {
	ranges = make([]CharRange, symbols.CharRangeSymbols.Len())
	for i, rng := range symbols.CharRangeSymbols.List() {
		cr := CharRange{
			Min:     rng.From.Val,
			Max:     rng.To.Val,
			Type:    symbols.Type(rng.String()),
			Comment: rng.String(),
		}
		ranges[i] = cr
	}
	return
}