Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -287,7 +287,7 @@ Added
Changed
-------

* Remove paranthesis from direct call.
* Remove parenthesis from direct call.


0.11
Expand Down
8 changes: 4 additions & 4 deletions devtools/bump-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions docs/preprocessor-language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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::

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ::

Expand Down Expand Up @@ -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:

Expand Down
8 changes: 4 additions & 4 deletions docs/various-features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,21 @@ 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

* the body of the `block` or `call` directive is evaluated in order to render
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
Expand Down Expand Up @@ -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`).


Expand Down
10 changes: 5 additions & 5 deletions src/fypp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tools/waf/fypp_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down Expand Up @@ -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
Expand Down