Skip to content

Conversation

@rocky
Copy link
Member

@rocky rocky commented Jun 28, 2025

Start tracking locations in specific expressions to aid error reporting and debugging.

We need some care to make sure we don't bloat memory with positions. Right now, we start locations are tagged for FunctionApplyRule, an ExpressionPattern -> Python method. Here, the location is the Python method, or rather can be extracted from that. So we can reuse the location information that Python is storing anyway.

For Expressions and ExpressionPatterns that are read in from Files, things are more complicated..

This needs to be coordinated with a changes in mathics-scanner of the same branch name.

@rocky rocky marked this pull request as draft June 28, 2025 01:51
@rocky rocky force-pushed the position-tracking branch 2 times, most recently from d373842 to 94e9f4e Compare June 28, 2025 10:09
for rule in rules:
result = rule.apply(self, evaluation, fully=True)
if result is not None and not result.sameQ(self):
if result.is_literal:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

@rocky rocky force-pushed the position-tracking branch from 1903ba2 to ca1aa14 Compare July 4, 2025 09:10
rocky added a commit that referenced this pull request Jul 4, 2025
…ion #1413 (#1414)

These are changes and slight bugs encounted in PR #1413

As a separate PR, this should reduce the size and effort for dealing with #1413, which I'll rebase after this is merged
@rocky rocky force-pushed the position-tracking branch 5 times, most recently from 675a80b to 9135c88 Compare July 6, 2025 15:53
@rocky rocky marked this pull request as ready for review July 6, 2025 15:57
@rocky rocky force-pushed the position-tracking branch from 9135c88 to 0ab994f Compare July 10, 2025 13:49
@rocky rocky merged commit 2fba7db into master Jul 12, 2025
27 of 33 checks passed
@rocky rocky deleted the position-tracking branch July 12, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants