cwl_utils.expression
====================

.. py:module:: cwl_utils.expression

.. autoapi-nested-parse::

   CWL Expression parsing.



Attributes
----------

.. autoapisummary::

   cwl_utils.expression.OLD_ESCAPE_CWL_VERSIONS


Classes
-------

.. autoapisummary::

   cwl_utils.expression.t


Functions
---------

.. autoapisummary::

   cwl_utils.expression.scanner
   cwl_utils.expression.evaluator
   cwl_utils.expression.interpolate
   cwl_utils.expression.jshead
   cwl_utils.expression.needs_parsing
   cwl_utils.expression.do_eval


Module Contents
---------------

.. py:data:: OLD_ESCAPE_CWL_VERSIONS
   :type:  Final[collections.abc.Container[str]]
   :value: ('v1.0', 'v1.1.0-dev1', 'v1.1', 'v1.2.0-dev1', 'v1.2.0-dev2', 'v1.2.0-dev3')


.. py:class:: t

   Bases: :py:obj:`enum.Enum`

   .. autoapi-inheritance-diagram:: cwl_utils.expression.t
      :parts: 1


   Tokens.


   .. py:attribute:: DEFAULT
      :value: 0



   .. py:attribute:: DOLLAR
      :value: 1



   .. py:attribute:: PAREN
      :value: 2



   .. py:attribute:: BRACE
      :value: 3



   .. py:attribute:: SINGLE_QUOTE
      :value: 4



   .. py:attribute:: DOUBLE_QUOTE
      :value: 5



   .. py:attribute:: BACKSLASH
      :value: 6



.. py:function:: scanner(scan)

   Find JS relevant punctuation in a string.


.. py:function:: evaluator(js_engine, ex, obj, jslib, fullJS, **kwargs)

.. py:function:: interpolate(scan, rootvars, jslib = '', fullJS = False, strip_whitespace = True, escaping_behavior = 2, convert_to_expression = False, js_engine = None, **kwargs)

   Interpolate and evaluate.

   Note: only call with convert_to_expression=True on CWL Expressions in $()
   form that need interpolation.


.. py:function:: jshead(engine_config, rootvars)

   Make sure all the byte strings are converted to str in `rootvars` dict.


.. py:function:: needs_parsing(snippet)

.. py:function:: do_eval(ex, jobinput, requirements, outdir, tmpdir, resources, context = None, timeout = default_timeout, strip_whitespace = True, cwlVersion = '', **kwargs)

   Evaluate the given CWL expression, in context.

   :param timeout: The maximum number of seconds to wait while executing.


