1 // Copyright 2018 Google LLC.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
18 package google.api.expr.v1beta1;
20 option cc_enable_arenas = true;
21 option go_package = "google.golang.org/genproto/googleapis/api/expr/v1beta1;expr";
22 option java_multiple_files = true;
23 option java_outer_classname = "SourceProto";
24 option java_package = "com.google.api.expr.v1beta1";
26 // Source information collected at parse time.
28 // The location name. All position information attached to an expression is
29 // relative to this location.
31 // The location could be a file, UI element, or similar. For example,
32 // `acme/app/AnvilPolicy.cel`.
35 // Monotonically increasing list of character offsets where newlines appear.
37 // The line number of a given position is the index `i` where for a given
38 // `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The
39 // column may be derivd from `id_positions[id] - line_offsets[i]`.
40 repeated int32 line_offsets = 3;
42 // A map from the parse node id (e.g. `Expr.id`) to the character offset
44 map<int32, int32> positions = 4;
47 // A specific position in source.
48 message SourcePosition {
49 // The soucre location name (e.g. file name).
52 // The character offset.
55 // The 1-based index of the starting line in the source text
56 // where the issue occurs, or 0 if unknown.
59 // The 0-based index of the starting position within the line of source text
60 // where the issue occurs. Only meaningful if line is nonzer..