Lines Matching full:gn
5 """Helper functions useful when writing scripts that integrate with GN.
8 serialized GN veriables and Python variables.
27 """Returns a stringified GN equivalent of the Python value.
30 to GN scopes. This is only possible at the top level, you can't nest a
31 GN scope in a list, so this should be set to False for recursive calls."""
63 raise GNException("Unsupported type when printing to GN.")
67 """Converts the input string from a GN serialized value to Python values.
71 If your GN script did:
79 You can parse this into a Python list using GN rules with:
82 will not handle GN escaping properly, nor GN booleans. You should use this
95 accepts only quoted strings like GN scripts. In such cases, you can just use
100 strings will be quoted and escaped according to GN rules so the list can be
107 """Converts a string with a bunch of gn arg assignments into a Python dict.
113 gn assignments, this returns a Python dict, i.e.:
128 """Given a string with GN escaping, returns the unescaped string.
132 fed into the GN unescaper."""
140 # These are the escaped characters GN supports.
157 """Duplicates GN parsing of values and converts to Python types.
175 """Converts a string representing a printed GN value to the Python type.
179 - GN booleans ('true', 'false') will be converted to Python booleans.
181 - GN numbers ('123') will be converted to Python numbers.
183 - GN strings (double-quoted as in '"asdf"') will be converted to Python
184 strings with GN escaping rules. GN string interpolation (embedded
188 - GN lists ('[1, "asdf", 3]') will be converted to Python lists.
190 - GN scopes ('{ ... }') are not supported."""