diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-07-11 17:02:51 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:03 +0000 |
commit | 2c7674169ab3368b7f2353ce04ba5b8692608867 (patch) | |
tree | cb1543c08152b02c19c5e993599790fe6c652069 /src/buildstream/node.pyx | |
parent | 301d40d1a42c056f7c9e8e734b6ce6251378cafb (diff) | |
download | buildstream-2c7674169ab3368b7f2353ce04ba5b8692608867.tar.gz |
node: make 'assert_symbol_name' private
This is not needed for plugins and should therefore not be public
Diffstat (limited to 'src/buildstream/node.pyx')
-rw-r--r-- | src/buildstream/node.pyx | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/buildstream/node.pyx b/src/buildstream/node.pyx index 30814b782..d20ff664f 100644 --- a/src/buildstream/node.pyx +++ b/src/buildstream/node.pyx @@ -824,7 +824,21 @@ cdef class ProvenanceInformation: return "{} [line {:d} column {:d}]".format(self._displayname, self._line, self._col) -# assert_symbol_name() +############################################################# +# BuildStream Private methods # +############################################################# +# Purely synthetic nodes will have _SYNTHETIC_FILE_INDEX for the file number, have line number +# zero, and a negative column number which comes from inverting the next value +# out of this counter. Synthetic nodes created with a reference node will +# have a file number from the reference node, some unknown line number, and +# a negative column number from this counter. +cdef int _SYNTHETIC_FILE_INDEX = -1 + +# File name handling +cdef list _FILE_LIST = [] + + +# _assert_symbol_name() # # A helper function to check if a loaded string is a valid symbol # name and to raise a consistent LoadError if not. For strings which @@ -842,7 +856,7 @@ cdef class ProvenanceInformation: # Note that dashes are generally preferred for variable names and # usage in YAML, but things such as option names which will be # evaluated with jinja2 cannot use dashes. -def assert_symbol_name(str symbol_name, str purpose, *, Node ref_node=None, bint allow_dashes=True): +def _assert_symbol_name(str symbol_name, str purpose, *, Node ref_node=None, bint allow_dashes=True): cdef str valid_chars = string.digits + string.ascii_letters + '_' if allow_dashes: valid_chars += '-' @@ -871,20 +885,6 @@ def assert_symbol_name(str symbol_name, str purpose, *, Node ref_node=None, bint message, detail=detail) -############################################################# -# BuildStream Private methods # -############################################################# -# Purely synthetic nodes will have _SYNTHETIC_FILE_INDEX for the file number, have line number -# zero, and a negative column number which comes from inverting the next value -# out of this counter. Synthetic nodes created with a reference node will -# have a file number from the reference node, some unknown line number, and -# a negative column number from this counter. -cdef int _SYNTHETIC_FILE_INDEX = -1 - -# File name handling -cdef list _FILE_LIST = [] - - cdef Py_ssize_t _create_new_file(str filename, str shortname, str displayname, Node toplevel, object project): cdef Py_ssize_t file_number = len(_FILE_LIST) _FILE_LIST.append(_FileInfo(filename, shortname, displayname, None, project)) |