From e3f5cf9f8d85d4300886bd1eb620ba1d43a481cb Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Sat, 13 Dec 2025 21:36:22 +0200 Subject: [PATCH] Fix typos in code and documentation --- CHANGELOG.rst | 4 ++-- devtools/bump-version.py | 8 ++++---- docs/examples.rst | 2 +- docs/getting-started.rst | 2 +- docs/introduction.rst | 2 +- docs/preprocessor-language.rst | 10 +++++----- docs/various-features.rst | 8 ++++---- src/fypp.py | 10 +++++----- tools/waf/fypp_preprocessor.py | 4 ++-- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c16d627..2b82ff7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -245,7 +245,7 @@ Added * Add waf integration modules. -* Examples and build system intergration chapters in user guide. +* Examples and build system integration chapters in user guide. * Change log file. @@ -287,7 +287,7 @@ Added Changed ------- -* Remove paranthesis from direct call. +* Remove parenthesis from direct call. 0.11 diff --git a/devtools/bump-version.py b/devtools/bump-version.py index df48122..959ba07 100755 --- a/devtools/bump-version.py +++ b/devtools/bump-version.py @@ -5,7 +5,7 @@ VERSION_PATTERN = r'\d+\.\d+(?:\.\d+)?(?:-\w+)?' FILES_PATTERNS = [ ('src/fypp.py', - r'^VERSION\s*=\s*([\'"]){}\1'.format(VERSION_PATTERN), + r'^VERSION\s*=\s*([\'"]){}\1'.format(VERSION_PATTERN), "VERSION = '{version}'"), ('docs/fypp.rst', r'Fypp Version[ ]*{}.'.format(VERSION_PATTERN), @@ -37,7 +37,7 @@ rootdir = os.path.join(os.path.dirname(sys.argv[0]), '..') for fname, regexp, repl in FILES_PATTERNS: fname = os.path.join(rootdir, fname) - print("Replacments in '{}': ".format(fname), end='') + print("Replacements in '{}': ".format(fname), end='') fp = open(fname, 'r') txt = fp.read() fp.close() @@ -48,10 +48,10 @@ fp.write(newtxt) fp.close() - + # Replace version number in Change Log and adapt decoration below fname = os.path.join(rootdir, 'CHANGELOG.rst') -print("Replacments in '{}': ".format(fname), end='') +print("Replacements in '{}': ".format(fname), end='') fp = open(fname, 'r') txt = fp.read() fp.close() diff --git a/docs/examples.rst b/docs/examples.rst index 4e8249b..ddffcd1 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -203,7 +203,7 @@ all the realizations with the different array ranks and precisions:: The macro ``ranksuffix()`` defined at the beginning receives a rank as argument and returns a string, which is either the empty string (rank 0) or the appropriate number of dimension placeholder separated by commas and within -parantheses (e.g. ``(:,:)`` for rank 2). The string expression is calculated as +parentheses (e.g. ``(:,:)`` for rank 2). The string expression is calculated as a Python expression, so that we can make use of the powerful string manipulation routines in Python and write it as a one-line routine. diff --git a/docs/getting-started.rst b/docs/getting-started.rst index b94a0c4..3f9969a 100644 --- a/docs/getting-started.rst +++ b/docs/getting-started.rst @@ -97,7 +97,7 @@ In order to execute the unit tests with `tox`, run :: from the root folder of the source tree. This tries to test Fypp with various different python interpreters. If you want to limit testing to selected -interpeters only, select the environment with the appropriate command line +interpreters only, select the environment with the appropriate command line switch, e.g. :: tox -e py34 diff --git a/docs/introduction.rst b/docs/introduction.rst index 3e92d2f..c0571b9 100644 --- a/docs/introduction.rst +++ b/docs/introduction.rst @@ -97,7 +97,7 @@ more in detail in the individual sections further down. #:include "macrodefs.fypp" -* Using Fortran-style continutation lines in preprocessor directives:: +* Using Fortran-style continuation lines in preprocessor directives:: #:if var1 > var2 & & or var2 > var4 diff --git a/docs/preprocessor-language.rst b/docs/preprocessor-language.rst index 8d497fc..2b9093e 100644 --- a/docs/preprocessor-language.rst +++ b/docs/preprocessor-language.rst @@ -295,7 +295,7 @@ For example:: fypp --define-mode=eval -DMYSTR="Hello" fypp --define-mode=str -DMYSTR=Hello -both assing the string ``"Hello"`` to ``MYSTR``. +both passing the string ``"Hello"`` to ``MYSTR``. Note: The ``--define-mode`` option controls the behavior of *all* ``-D`` options, but leaves the ``-S`` and ``-E`` options unaffected. The execution @@ -402,7 +402,7 @@ right hand side of the assignment is compatible with the variable tuple:: #:set VAR1, VAR2 = 1, 2 #:set (VAR1, VAR2) = 1, 2 -The parantheses around the variable list (second example) are optional. +The parentheses around the variable list (second example) are optional. The `set` directive can be also used in the inline form:: @@ -521,7 +521,7 @@ single and double precision reals:: #:endfor The `for` directive expects a loop variable expression and an iterable -separated by the ``in`` keyword. The code within the `for` directive is outputed +separated by the ``in`` keyword. The code within the `for` directive is outputted for every iteration with the current value of the loop variable, which can be inserted using eval directives. The loop variable expression must be either a name or a list of names joined by comma (``,``). In the latter case, the @@ -567,7 +567,7 @@ regular callable in Python, which returns the rendered content of the macro body when called. The macro arguments are converted to local variables containing the actual arguments as values. The macro can be called from within an eval-directive, via the `call` and `block` control directives and via their -abreviated form, the direct call. +abbreviated form, the direct call. Given the macro definition :: @@ -845,7 +845,7 @@ comfortable when the callable needs also non-string type of arguments:: this will be repeated 3 times #:endcall REPEAT_CODE -The arguments must be specified between parantheses and are evaluated as Python +The arguments must be specified between parentheses and are evaluated as Python expressions. The arguments specified in the directive (both, in the header and in the body) are passed to the callable in the following order: diff --git a/docs/various-features.rst b/docs/various-features.rst index eb425ff..b5403b1 100644 --- a/docs/various-features.rst +++ b/docs/various-features.rst @@ -152,13 +152,13 @@ Fypp uses a scope concept very similar to Pythons one. There is one global scope (like in Python modules), and temporary local scopes may be created in special cases (e.g. during macro calls). -The global scope is the one, which Fypp normaly uses for defining objects. All +The global scope is the one, which Fypp normally uses for defining objects. All imports specified on the command line are carried out in this scope And all definitions made by the `set` and `def` directives in the processed source file defines entities in that scope, unless they appear within a `block`, a `call` or a `def` directive. -Addtional temporary local scopes are opened, whenever +Additional temporary local scopes are opened, whenever * a macro defined by the `def` directive is called, or @@ -166,7 +166,7 @@ Addtional temporary local scopes are opened, whenever the text, which will be passed to the callable as argument. Any entity defined in a local scope is only visible within that scope and is -unaccessible once the scope has been closed. For example the code snippet:: +inaccessible once the scope has been closed. For example the code snippet:: #:set toupper = lambda s: s.upper() #:call toupper @@ -306,7 +306,7 @@ codes to the calling environment: * 1: Stopped due to an unexpected error. -* 2: Explicitely requested stop encountered (:ref:`stop-directive` or +* 2: Explicitly requested stop encountered (:ref:`stop-directive` or :ref:`assert-directive`). diff --git a/src/fypp.py b/src/fypp.py index c6d0154..39bdf97 100755 --- a/src/fypp.py +++ b/src/fypp.py @@ -207,7 +207,7 @@ class FyppFatalError(FyppError): class FyppStopRequest(FyppError): - '''Signalizes an explicitely triggered stop (e.g. via stop directive)''' + '''Signalizes an explicitly triggered stop (e.g. via stop directive)''' class Parser: @@ -1328,7 +1328,7 @@ class Renderer: format, and 'gfortran5' adds to cpp a workaround for a bug introduced in GFortran 5. linefolder (callable): Callable to use when folding a line. filevarroot (str, optional): render _FILE_ and _THIS_FILE_ as paths relative to this - root directory (default: paths are not converted explicitely to relative paths) + root directory (default: paths are not converted explicitly to relative paths) ''' def __init__(self, evaluator=None, linenums=False, contlinenums=False, @@ -1882,7 +1882,7 @@ class Evaluator: to None. ''' - # Restricted builtins working in all supported Python verions. Version + # Restricted builtins working in all supported Python versions. Version # specific ones are added dynamically in _get_restricted_builtins(). _RESTRICTED_BUILTINS = { 'abs': builtins.abs, @@ -2255,7 +2255,7 @@ class _Macro: '''Represents a user defined macro. - This object should only be initiatied by a Renderer instance, as it + This object should only be initialized by a Renderer instance, as it needs access to Renderers internal variables and methods. Args: @@ -2908,7 +2908,7 @@ def get_option_parser(): msg = 'line folding mode, \'smart\' (default): indentation context '\ 'and whitespace aware, \'simple\': indentation context aware, '\ - '\'brute\': mechnical folding' + '\'brute\': mechanical folding' parser.add_option('-f', '--folding-mode', metavar='MODE', choices=['smart', 'simple', 'brute'], dest='folding_mode', default=defs.folding_mode, help=msg) diff --git a/tools/waf/fypp_preprocessor.py b/tools/waf/fypp_preprocessor.py index 8bed0a6..832a95c 100644 --- a/tools/waf/fypp_preprocessor.py +++ b/tools/waf/fypp_preprocessor.py @@ -7,7 +7,7 @@ This module implements the general framework for the Fypp preprocessor, but does not bind it to any task generator. If you want to use it to preprocessor Fortran source files (.fpp -> .f90), use the fypp_fortran module instead. Otherwise, -you can generate your own binding as ususal:: +you can generate your own binding as usual:: def build(bld): bld(features='fypp', source=['test.fypp']) @@ -179,7 +179,7 @@ def parse(self, node): '''Parser the includes in a given node. :return: Tuple with two elements: list of dependent nodes and list of - unresolved depencies. + unresolved dependencies. ''' self._waiting = [ node, ] # self._waiting is eventually extended during _process() -> iterate