MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / t_SCI

Function t_SCI

SLiCAP/SLiCAPlex.py:142–155  ·  view source on GitHub ↗

r'[+-]?\d+\.?\d*[eE][+-]?\d+

(t)

Source from the content-addressed store, hash-verified

140 return t
141
142def t_SCI(t):
143 r'[+-]?\d+\.?\d*[eE][+-]?\d+'
144 """
145 Converts a string representing a number in scientific notation into a
146 float.
147 """
148 try:
149 t.value = sp.Rational(t.value)
150 t.type = 'FLT'
151 except TypeError:
152 exc_type, value, exc_traceback = sys.exc_info()
153 print('\n', value)
154 _printError('Cannot convert number to float.', t)
155 return t
156
157# Define a rule so we can track line numbers
158def t_NEWLINE(t):

Callers

nothing calls this directly

Calls 1

_printErrorFunction · 0.85

Tested by

no test coverage detected