Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Side by Side Diff: mojom/mojom_parser/mojom/mojom_descriptor.go

Issue 1766463002: Implement formatting exclusion. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojom/mojom_parser/formatter/printer.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package mojom 5 package mojom
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "fmt" 9 "fmt"
10 "mojom/mojom_parser/lexer" 10 "mojom/mojom_parser/lexer"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 return mojomUnion.RegisterInScope(f.FileScope) 245 return mojomUnion.RegisterInScope(f.FileScope)
246 } 246 }
247 247
248 func (f *MojomFile) AddConstant(declaredConst *UserDefinedConstant) DuplicateNam eError { 248 func (f *MojomFile) AddConstant(declaredConst *UserDefinedConstant) DuplicateNam eError {
249 f.DeclaredObjects = append(f.DeclaredObjects, declaredConst) 249 f.DeclaredObjects = append(f.DeclaredObjects, declaredConst)
250 f.Constants = append(f.Constants, declaredConst) 250 f.Constants = append(f.Constants, declaredConst)
251 f.checkInit() 251 f.checkInit()
252 return declaredConst.RegisterInScope(f.FileScope) 252 return declaredConst.RegisterInScope(f.FileScope)
253 } 253 }
254 254
255 func (f *MojomFile) FileContents() string {
256 return f.fileContents
257 }
258
255 func (f *MojomFile) checkInit() { 259 func (f *MojomFile) checkInit() {
256 if f.FileScope == nil { 260 if f.FileScope == nil {
257 panic("InitializeFileScope must be invoked first.") 261 panic("InitializeFileScope must be invoked first.")
258 } 262 }
259 } 263 }
260 264
261 ////////////////////////////////////////////////////////////////// 265 //////////////////////////////////////////////////////////////////
262 /// type MojomDescriptor 266 /// type MojomDescriptor
263 /// ////////////////////////////////////////////////////////////// 267 /// //////////////////////////////////////////////////////////////
264 268
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 typeKey = fmt.Sprintf("TYPE_KEY:%s", fullyQualifiedName) 758 typeKey = fmt.Sprintf("TYPE_KEY:%s", fullyQualifiedName)
755 fqnToTypeKey[fullyQualifiedName] = typeKey 759 fqnToTypeKey[fullyQualifiedName] = typeKey
756 return 760 return
757 } 761 }
758 762
759 var fqnToTypeKey map[string]string 763 var fqnToTypeKey map[string]string
760 764
761 func init() { 765 func init() {
762 fqnToTypeKey = make(map[string]string) 766 fqnToTypeKey = make(map[string]string)
763 } 767 }
OLDNEW
« no previous file with comments | « mojom/mojom_parser/formatter/printer.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698