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

Side by Side Diff: tools/gn/input_conversion.cc

Issue 2186683003: GN: update error message for invalid input_conversion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "tools/gn/input_conversion.h" 5 #include "tools/gn/input_conversion.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 if (input_conversion == "value") 133 if (input_conversion == "value")
134 return ParseValueOrScope(settings, input, PARSE_VALUE, origin, err); 134 return ParseValueOrScope(settings, input, PARSE_VALUE, origin, err);
135 if (input_conversion == "string") 135 if (input_conversion == "string")
136 return Value(origin, input); 136 return Value(origin, input);
137 if (input_conversion == "list lines") 137 if (input_conversion == "list lines")
138 return ParseList(input, origin, err); 138 return ParseList(input, origin, err);
139 if (input_conversion == "scope") 139 if (input_conversion == "scope")
140 return ParseValueOrScope(settings, input, PARSE_SCOPE, origin, err); 140 return ParseValueOrScope(settings, input, PARSE_SCOPE, origin, err);
141 141
142 *err = Err(original_input_conversion, "Not a valid input_conversion.", 142 *err = Err(original_input_conversion, "Not a valid input_conversion.",
143 "Have you considered a career in retail?"); 143 "Run gn help input_conversion to see your options.");
144 return Value(); 144 return Value();
145 } 145 }
146 146
147 } // namespace 147 } // namespace
148 148
149 extern const char kInputConversion_Help[] = 149 extern const char kInputConversion_Help[] =
150 "input_conversion: Specifies how to transform input to a variable.\n" 150 "input_conversion: Specifies how to transform input to a variable.\n"
151 "\n" 151 "\n"
152 " input_conversion is an argument to read_file and exec_script that\n" 152 " input_conversion is an argument to read_file and exec_script that\n"
153 " specifies how the result of the read operation should be converted\n" 153 " specifies how the result of the read operation should be converted\n"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 const ParseNode* origin, 204 const ParseNode* origin,
205 const Value& input_conversion_value, 205 const Value& input_conversion_value,
206 Err* err) { 206 Err* err) {
207 if (input_conversion_value.type() == Value::NONE) 207 if (input_conversion_value.type() == Value::NONE)
208 return Value(); // Allow null inputs to mean discard the result. 208 return Value(); // Allow null inputs to mean discard the result.
209 if (!input_conversion_value.VerifyTypeIs(Value::STRING, err)) 209 if (!input_conversion_value.VerifyTypeIs(Value::STRING, err))
210 return Value(); 210 return Value();
211 return DoConvertInputToValue(settings, input, origin, input_conversion_value, 211 return DoConvertInputToValue(settings, input, origin, input_conversion_value,
212 input_conversion_value.string_value(), err); 212 input_conversion_value.string_value(), err);
213 } 213 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698