Lines Matching refs:parser
37 res, err := parser.Print(tree)
167 tree *parser.File
170 func (f Fixer) Tree() *parser.File {
174 func NewFixer(tree *parser.File) *Fixer {
185 func (f *Fixer) Fix(config FixRequest) (*parser.File, error) {
216 bytes, err := parser.Print(f.tree)
224 buf, err := parser.Print(f.tree)
236 func parse(name string, r io.Reader) (*parser.File, error) {
237 tree, errs := parser.Parse(name, r, parser.NewScope(nil))
258 func simplifyKnownPropertiesDuplicatingEachOther(mod *parser.Module, buf []byte, patchList *parser.…
266 mod, ok := def.(*parser.Module)
285 src, ok := srcs.Values[0].(*parser.String)
307 mod, ok := def.(*parser.Module)
335 defaults := &parser.Property{
337 Value: &parser.List{
338 Values: []parser.Expression{
339 &parser.String{
353 mod, ok := def.(*parser.Module)
390 mod, ok := def.(*parser.Module)
431 mod, ok := def.(*parser.Module)
447 mod, ok := def.(*parser.Module)
460 prop := &parser.Property{
462 Value: &parser.Bool{
474 func getStringProperty(prop *parser.Property, fieldName string) string {
475 if propsAsMap, ok := prop.Value.(*parser.Map); ok {
478 if propFieldAsString, ok := propField.Value.(*parser.String); ok {
490 func indicateAttributeError(mod *parser.Module, attributeName string, format string, a ...interface…
492 mod.Properties = append(mod.Properties, &parser.Property{
494 Value: &parser.String{Value: "ERROR: " + msg},
503 func resolveLocalModule(mod *parser.Module, val parser.Expression) parser.Expression {
504 if varLocalName, ok := val.(*parser.Variable); ok {
534 func (f etcPrebuiltModuleUpdate) update(m *parser.Module, path string) bool {
539 m.Properties = append(m.Properties, &parser.Property{
541 Value: &parser.String{Value: trimmedPath},
547 …m.Properties = append(m.Properties, &parser.Property{Name: flag, Value: &parser.Bool{Value: true, …
576 mod, ok := def.(*parser.Module)
624 mod, ok := def.(*parser.Module)
648 mod, ok := def.(*parser.Module)
656 if certStr, ok := cert.Value.(*parser.String); ok {
659 prop := &parser.Property{
661 Value: &parser.Bool{
675 mod, ok := def.(*parser.Module)
681 prop := &parser.Property{
683 Value: &parser.Bool{
707 mod, ok := def.(*parser.Module)
716 newValues := []parser.Expression{}
718 stringValue, ok := v.(*parser.String)
740 mod, ok := def.(*parser.Module)
751 newDefs := make([]parser.Definition, 0, len(f.tree.Defs))
753 if mod, ok := def.(*parser.Module); ok && mod.Type == "soong_config_bool_variable" {
769 return runPatchListMod(func(mod *parser.Module, buf []byte, patchList *parser.PatchList) error {
782 nameValue, ok := item.(*parser.String)
798 *patchList = parser.PatchList{}
823 func convertToSingleSource(mod *parser.Module, srcPropertyName string) {
825 if srcList, ok := srcs.Value.(*parser.List); ok {
829 &parser.Property{
837 } else if _, ok = srcs.Value.(*parser.Variable); ok {
840 &parser.Property{Name: srcPropertyName,
850 func runPatchListMod(modFunc func(mod *parser.Module, buf []byte, patchlist *parser.PatchList) erro…
858 var patchlist parser.PatchList
860 mod, ok := def.(*parser.Module)
899 func reorderCommonProperties(mod *parser.Module, buf []byte, patchlist *parser.PatchList) error {
945 func removeTags(mod *parser.Module, buf []byte, patchlist *parser.PatchList) error {
950 list, ok := prop.Value.(*parser.List)
958 str, ok := item.(*parser.String)
1020 func removePdkProperty(mod *parser.Module, buf []byte, patchlist *parser.PatchList) error {
1025 propMap, ok := prop.Value.(*parser.Map)
1039 func mergeMatchingModuleProperties(mod *parser.Module, buf []byte, patchlist *parser.PatchList) err…
1043 func mergeMatchingProperties(properties *[]*parser.Property, buf []byte, patchlist *parser.PatchLis…
1044 seen := make(map[string]*parser.Property)
1055 if mapProperty, ok := property.Value.(*parser.Map); ok {
1066 func mergeProperties(a, b *parser.Property, buf []byte, patchlist *parser.PatchList) error {
1069 if _, isVar := a.Value.(*parser.Variable); isVar {
1072 if _, isVar := b.Value.(*parser.Variable); isVar {
1080 case parser.StringType:
1082 case parser.ListType:
1089 func mergeListProperties(a, b *parser.Property, buf []byte, patchlist *parser.PatchList) error {
1090 aval, oka := a.Value.(*parser.List)
1091 bval, okb := b.Value.(*parser.List)
1125 func filterExpressionList(patchList *parser.PatchList, items *parser.List, removals *parser.List) {
1130 equal, err := parser.ExpressionsAreSame(item, removal)
1150 func removeMatchingModuleListProperties(mod *parser.Module, patchList *parser.PatchList, canonicalN…
1155 legacyList, ok := legacyProp.Value.(*parser.List)
1164 localPatches := parser.PatchList{}
1178 func hasNonEmptyLiteralListProperty(mod *parser.Module, name string) bool {
1183 func hasNonEmptyLiteralStringProperty(mod *parser.Module, name string) bool {
1188 func getLiteralListProperty(mod *parser.Module, name string) (list *parser.List, found bool) {
1193 list, ok = prop.Value.(*parser.List)
1197 func getLiteralListPropertyValue(mod *parser.Module, name string) (list []string, found bool) {
1203 stringValue, ok := v.(*parser.String)
1213 func getLiteralStringProperty(mod *parser.Module, name string) (s *parser.String, found bool) {
1218 s, ok = prop.Value.(*parser.String)
1222 func getLiteralStringPropertyValue(mod *parser.Module, name string) (s string, found bool) {
1231 func getLiteralBoolProperty(mod *parser.Module, name string) (b *parser.Bool, found bool) {
1236 b, ok = prop.Value.(*parser.Bool)
1240 func getLiteralBoolPropertyValue(mod *parser.Module, name string) (s bool, found bool) {
1249 func propertyIndex(props []*parser.Property, propertyName string) int {
1258 func renameProperty(mod *parser.Module, from, to string) {
1266 func removeProperty(mod *parser.Module, propertyName string) {
1267 newList := make([]*parser.Property, 0, len(mod.Properties))