Skip to content

Add Strict Syntax Checking Option#38

Merged
kilo52 merged 6 commits intomasterfrom
feature/ast-lenient-eval
Mar 15, 2026
Merged

Add Strict Syntax Checking Option#38
kilo52 merged 6 commits intomasterfrom
feature/ast-lenient-eval

Conversation

@kilo52
Copy link
Copy Markdown
Member

@kilo52 kilo52 commented Mar 14, 2026

Adds the strict flag to the RcnStatOptions struct.

Adds the rcnCountLogicalLinesStrict() API function to reflect the old behaviour. The already existing rcnCountLogicalLines() API function changes the behaviour to be lenient. Since the exact counting behaviour is not part of the API contract, as documented, the change in behaviour is not a breaking change.

Introduces the --strict option in scount for strict syntax checking.

Updates relevant functions to handle strict mode, causing immediate failure on syntax errors.

Added `strict` flag to RcnStatOptions struct.

Added `rcnCountLogicalLinesStrict()` API function to reflect the old behaviour. The already existing `rcnCountLogicalLines()` API function changes the behaviour to be lenient. Since the exact counting behaviour is not part of the API contract, as documented, the change in behaviour is not a breaking change.

Introduced `--strict` option in `scount` for strict syntax checking.

Updated relevant functions to handle strict mode, causing immediate failure on syntax errors.

Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
@kilo52 kilo52 self-assigned this Mar 14, 2026
@kilo52 kilo52 added Improvement Improvement of an existing feature Feature New feature labels Mar 14, 2026
@kilo52 kilo52 linked an issue Mar 14, 2026 that may be closed by this pull request
kilo52 added 5 commits March 14, 2026 21:53
…handling.

Moved strict flag from evaluateSourceTree() function parameter to NodeEvalTrace struct.

Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Added check for empty soruce code input which fails when in strict mode but returns with success and zero count result when in lenient mode.

Adjusted unit tests.

Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
@kilo52 kilo52 merged commit 277b48a into master Mar 15, 2026
22 checks passed
@kilo52 kilo52 deleted the feature/ast-lenient-eval branch March 16, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature Improvement Improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make AST Evaluation Lenient by Default

1 participant