openc3-cosmos-script-engine-cstol 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cstol_script_engine.py +10 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf6da20d0573092cb540326e468769c97ff84a6c28f13dcf34e35f14de64686c
4
- data.tar.gz: d2d54f8b7eba61bdc7cf5b3645fc2b6454f3a55d15cc8a7020af981e67f866b0
3
+ metadata.gz: d0dfd6b3382cbfb7f4b73349047d0694aeab39e52ac67c0606b55a14afb2c814
4
+ data.tar.gz: 59d7c0c79e2f1d8cfc9a17466d6deb3d6d60cfa0912f255074f5307509026f1b
5
5
  SHA512:
6
- metadata.gz: ee15613e7146e593cce0b3b4e2bf542433f9b5ab7e5751e28bbea83c6eba04cd891ac92e67c7897eec88b96d2f9d2dea9f30e376ac31ae276d87ca94d0234caa
7
- data.tar.gz: 2fb8c91c241e6a2047c3382318cd305f74981b66586e2b2ffd1af90541d4b729ef24197cfd2825898a00436dd45aca34fa0dd2531eb29e025f6272e0f3dcd8ee
6
+ metadata.gz: 97127866fe1b94549e7ea10513f047228df0dcbdff6ed03353ed7f50b9587e89244d00ea771c056138faef11c998eb9292dc95bd2a7c6428da7fabcb47d72fa2
7
+ data.tar.gz: c222c13292265034cca2f091e04da0e1f32bfefdb5f6e39118ddb4845287aac8edca27feee42fbcd4aeb5bf706c2d86e12d0468da386dcf09037f4bde7dcb1f4
@@ -450,10 +450,10 @@ class CstolScriptEngine(ScriptEngine):
450
450
  # Use regex to extract the numeric part (including scientific notation)
451
451
  # This pattern matches:
452
452
  # - Optional sign (+/-)
453
- # - Digits, optional decimal point and more digits
453
+ # - Digits with an optional decimal point, or a leading-dot fraction
454
454
  # - Optional scientific notation (e/E followed by optional sign and digits)
455
455
  # - Ignores any alphabetic characters that follow
456
- matches = re.match(r"^([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)", token)
456
+ matches = re.match(r"^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)", token)
457
457
  if matches is not None:
458
458
  final_tokens.append(str(matches.group(1)))
459
459
  previous_number = True
@@ -934,7 +934,14 @@ class CstolScriptEngine(ScriptEngine):
934
934
  raise ValueError(
935
935
  f"Expected '=' after variable name in DECLARE command at line {line_no}"
936
936
  )
937
- default_value = self.evaluate_tokens([tokens[4]])[0]
937
+ default_end = 6 if tokens[4] in ("+", "-") else 5
938
+ default_tokens = tokens[4:default_end]
939
+ scientific_default = "".join(tokens[4 : default_end + 2])
940
+ if re.fullmatch(
941
+ r"[+-]?(?:\d+(?:\.\d*)?|\.\d+)[eE][+-]\d+(?:[A-Za-z]+)?", scientific_default
942
+ ):
943
+ default_tokens = [scientific_default]
944
+ default_value = self.evaluate_expression(default_tokens)
938
945
  if mode == "INPUT" and self.variables.has_local_variable(variable_name):
939
946
  # INPUT variables are passed in by the PROC argument list, so the
940
947
  # default value is only applied when an argument wasn't given
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openc3-cosmos-script-engine-cstol
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenC3, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-19 00:00:00.000000000 Z
11
+ date: 2026-11-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: " This plugin provides a script engine to support CSTOL in Script Runner\n"
14
14
  email: