Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MathNotation] Implement Sectioning #299

Merged
merged 5 commits into from
Jun 26, 2024
Merged

[MathNotation] Implement Sectioning #299

merged 5 commits into from
Jun 26, 2024

Conversation

shingarov
Copy link
Owner

No description provided.

@shingarov shingarov force-pushed the sectioning branch 6 times, most recently from de564dc to 3c13e37 Compare June 23, 2024 01:18
@shingarov shingarov requested a review from janvrany June 23, 2024 01:20
@shingarov shingarov force-pushed the sectioning branch 3 times, most recently from b63e3cc to 13ec844 Compare June 23, 2024 15:49
Copy link
Collaborator

@janvrany janvrany left a comment

Choose a reason for hiding this comment

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

I think this need more work. Once you have hole, syntax highlighting just stop working (for the method). Any kind of refactoring (renaming a variable, say) just writes back the full block:

holeOne: x
	self iconNamed: 'aaa'.
	^ [ :_ß198 | x + _ß198 ]

Trying something like:

hole2: a
	^ { □ }

gives you back error Unknown variable _ß123.

In the RB parser, nodes are stateful objects which perform some of the
parser's work.  For one example, nodes are reparented during parsing;
this happens down a chain of sends between nodes.  If a parse error is
discovered during execution of a node's method, the RBParser's explicit
(non-exception) juggling of RBParseErrorNodes is out of reach (at a
minimum, because nodes don't know the parser who is manipulating them).

This commit allows RBNodes to signal `parserError: aString` as if it
happened in the RBParser, by unwinding to the nearest RBParser context.
This is an ad-hoc hack, but the solution I would like (cf. megaparsec)
would involve having a language with first-class composition, which is
what we are trying to build, and need this support in the substrate for.
See RBHoleToken class comment for a general description of how this
works.  We shall give more meaningful examples when we implement
Squiggol (hopefully in the next few PRs).

Things are going to become much more interesting when we implement LqST
so Smalltalk blocks are routed to Core.
@shingarov
Copy link
Owner Author

^ { □ }

Yeah, that's pretty annoying.
Hopefully 799f663 is an improvement in that respect. It's quite horrible but as I say in that commit message, "the real solution would involve having a language with first-class composition".

syntax highlighting just stop working (for the method). Any kind of refactoring (renaming a variable, say) just writes back the full block

That would be "future improvements" to tooling. One could open a Feature Request to have "syntax highlighting of code with sectioned sends". This PR per se does not introduce a regression, because no-one on the planet ever had "syntax highlighting of code with sectioned sends" in the first place.

With refactoring it's the same but worse. If by "refactoring" we mean what our competitors do in 2024, e.g. how MS VisualStudio can call LiquidHaskell to ensure the refactoring preserves semantics, then we simply don't have refactoring. If we mean 1997-ish John-Brant-style refactoring, I think I last used it in around 2000 or 2001, back then it seemed cool and potentially useful. To my taste, I'd simply remove those ~100KLOC from Useful8 just like many Calypso plugins are removed, when they crash tools, break text rendering etc without giving nothing in return. Oh, thanks for reminding me: I completely forgot to push a bunch more crud-removals to Useful8.

@janvrany
Copy link
Collaborator

If we mean 1997-ish John-Brant-style refactoring, I think I last used it in around 2000 or 2001,

The fact that you do not use it does not mean it is not useful nor nobody else uses it. Just like the fact I do not use vim does not mean not mean it is not useful to that nobody else uses it.

The fact that tools are broken is not an excuse to break them even more.

That being said, if you think it's okay, then merge it.

@shingarov shingarov merged commit 1dda95b into pure-z3 Jun 26, 2024
3 checks passed
@shingarov shingarov deleted the sectioning branch June 26, 2024 16:46
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.

2 participants