René's URL Explorer Experiment


Title: Fix two #223 regressions: "-(x+1)**2" sign and "- -x" as "--x" by sspickle · Pull Request #225 · vpython/glowscript · GitHub

Open Graph Title: Fix two #223 regressions: "-(x+1)**2" sign and "- -x" as "--x" by sspickle · Pull Request #225 · vpython/glowscript

X Title: Fix two #223 regressions: "-(x+1)**2" sign and "- -x" as "--x" by sspickle · Pull Request #225 · vpython/glowscript

Description: Fixes two regressions from #223 (#170). Before #223, the preprocessor's "-" → "-1*" rewrite hid two RapydScript bugs, and removing it exposed both. glowscript.org has been rolled back to the version before #223 (20261101t092705) until this is merged. 1. -(x+1)**2 came out positive RapydScript's parser gave unary operators higher precedence than **, so -x**2 parsed as (-x)**2. The output stage then turned that back into -Math.pow(x, 2), but only when the unary had no parentheses. Everything else came out with the wrong sign: Python with #223 this PR -(x+1)**2 (x = 5) -36 36 -36 -(x)**2 -25 25 -25 -(2)**2 -4 4 -4 - -x**2 25 -25 25 exp(-(x-3)**2/8) 0.61 1.65 0.61 Fix (61d0edf): maybe_unary now parses Python's primary ** factor itself. After an atom, ** takes the next unary expression as its right operand. That makes ** bind tighter than a unary operator on its left, and makes it group right to left. That also fixes two items from #224: 2**3**2 (was 64, now 512) and 2**-1**2 (was 0.25, now 0.5). Reported upstream as kovidgoyal/rapydscript-ng#195; Kovid fixed it the same way in kovidgoyal/rapydscript-ng@50aa052 (Nov 3). 2. - -x compiled to --x RapydScript printed a unary operator directly against its operand, so - -x became --x. In JavaScript that's a pre-decrement: it gives the wrong value and changes x. - -3 was a syntax error, so the program didn't compile at all. Fix (b185ec0): print_unary_prefix now adds a space when a sign operator follows another sign operator. Upstream fixed this the same day as kovidgoyal/rapydscript-ng#194 (ec30155). Testing tests/test_compiler.py compiles 31 expressions with the bundled compiler under node and compares each result with CPython: 10 repeated-sign cases and 21 power/unary cases. Before the fixes, 4 and 9 of them fail. After, all pass. It skips if node isn't installed, and python -m pytest --noconftest tests/test_compiler.py runs it without the Flask app. Through GlowScriptOffline: Check Before #223 #223 This PR 122-row arithmetic table, rows differing from CPython 34 15 13 Power table (17 rows) all match 8 wrong all match #170 39-case program 0 failures 23 bundled demos all run The 13 rows still differing are the known %, round-half, bool and e items from #224. **kwargs in calls and definitions, comprehensions, and conditionals containing ** all behave as before. The same compiler is on vpython/rsWVPRunner#5, and the trinket trials will run it as rsWVPRunner v3.2.4-rc3. 🤖 Generated with Claude Code

Open Graph Description: Fixes two regressions from #223 (#170). Before #223, the preprocessor's "-" → "-1*" rewrite hid two RapydScript bugs, and removing it exposed both. glowscript.org has been r...

X Description: Fixes two regressions from #223 (#170). Before #223, the preprocessor's "-" → "-1*" rewrite hid two RapydScript bugs, and removing it exposed both. glows...

Opengraph URL: https://github.com/vpython/glowscript/pull/225

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:d7d8982d-53e6-0619-c78d-9efd47de6d9f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9104:BCAF9:1BCB9:27C86:6B007D7F
html-safe-nonce33d005229cf89e0be6bbf34618447d934edff9d4a3d12afbeb3ab84c60abb474
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTA0OkJDQUY5OjFCQ0I5OjI3Qzg2OjZCMDA3RDdGIiwidmlzaXRvcl9pZCI6IjY5MzgxNTM0MTk0NDE5OTUxMzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac473869fdda80f08e37296a97362c815cc5b0e93e49d953ee2551a077edc8c048
hovercard-subject-tagpull_request:5135387868
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/vpython/glowscript/pull/225/files
twitter:imagehttps://avatars.githubusercontent.com/u/1708412?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1708412?s=400&v=4
og:image:altFixes two regressions from #223 (#170). Before #223, the preprocessor's "-" → "-1*" rewrite hid two RapydScript bugs, and removing it exposed both. glowscript.org has been r...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None82c186f13e104004ab7bdb779f3195e59dd38bfde531aaa74b76470fc2462b83
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/vpython/glowscript git https://github.com/vpython/glowscript.git
octolytics-dimension-user_id1280757
octolytics-dimension-user_loginvpython
octolytics-dimension-repository_id187905631
octolytics-dimension-repository_nwovpython/glowscript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id187905631
octolytics-dimension-repository_network_root_nwovpython/glowscript
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released1bc2aa1939001689f5ce935982c10a6138f745c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/vpython/glowscript/pull/225/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvpython%2Fglowscript%2Fpull%2F225%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvpython%2Fglowscript%2Fpull%2F225%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=vpython%2Fglowscript
Reloadhttps://github.com/vpython/glowscript/pull/225/files
Reloadhttps://github.com/vpython/glowscript/pull/225/files
Reloadhttps://github.com/vpython/glowscript/pull/225/files
vpythonhttps://github.com/vpython
glowscripthttps://github.com/vpython/glowscript
Codehttps://github.com/vpython/glowscript
Issues9 (9)https://github.com/vpython/glowscript/issues
Pull requests2 (2)https://github.com/vpython/glowscript/pulls
Actionshttps://github.com/vpython/glowscript/actions
Projectshttps://github.com/vpython/glowscript/projects
Security and qualityhttps://github.com/vpython/glowscript/security
Insightshttps://github.com/vpython/glowscript/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fvpython%2Fglowscript%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fvpython%2Fglowscript%2Fissues%2Fnew%2Fchoose
sspicklehttps://github.com/sspickle
masterhttps://github.com/vpython/glowscript/tree/master
fix/unary-double-minushttps://github.com/vpython/glowscript/tree/fix/unary-double-minus
Conversation 3 https://github.com/vpython/glowscript/pull/225
Commits 3 https://github.com/vpython/glowscript/pull/225/commits
Checks 0 https://github.com/vpython/glowscript/pull/225/checks
Files changed https://github.com/vpython/glowscript/pull/225/files
Please reload this pagehttps://github.com/vpython/glowscript/pull/225/files
Fix two #223 regressions: "-(x+1)**2" sign and "- -x" as "--x" https://github.com/vpython/glowscript/pull/225/files#top
Show all changes 3 commits https://github.com/vpython/glowscript/pull/225/files
b185ec0 fix: "- -x" compiled to the JavaScript decrement "--x" sspickle Nov 3, 2026 https://github.com/vpython/glowscript/pull/225/commits/b185ec01936109d66d5c28e2f477feded7cd76ed
61d0edf fix: parse ** tighter than a unary operator on its left, as Python does sspickle Nov 3, 2026 https://github.com/vpython/glowscript/pull/225/commits/61d0edf281417289e5a257ede735d40328be9054
98805c6 Rebuild the 3.2 RScompiler package with the sign and power fixes sspickle Nov 5, 2026 https://github.com/vpython/glowscript/pull/225/commits/98805c68ee67d1db6b8c2b471f821ca2bf572df7
Clear filters https://github.com/vpython/glowscript/pull/225/files
Please reload this pagehttps://github.com/vpython/glowscript/pull/225/files
Please reload this pagehttps://github.com/vpython/glowscript/pull/225/files
RScompiler.3.2.min.js https://github.com/vpython/glowscript/pull/225/files#diff-50f3f718ff48010287d03a68f18aa6f64417d1048e5afe73c8cca752fc369ed2
compiler.js https://github.com/vpython/glowscript/pull/225/files#diff-21eb8966935b010d58675f21c5bccddd4453bf04f265127cd4ed00cb5e20680e
RScompiler.3.2.min.js https://github.com/vpython/glowscript/pull/225/files#diff-1e087fded8593149d31432ac69ef174d42b7b638de687c35459926f5160555ce
test_compiler.py https://github.com/vpython/glowscript/pull/225/files#diff-e34b71b4a9e5180dd896d166086e60748a08cfb8359021ec17d8ba5f8cb9bbd5
GlowScriptOffline/glowscript_libraries/RScompiler.3.2.min.jshttps://github.com/vpython/glowscript/pull/225/files#diff-50f3f718ff48010287d03a68f18aa6f64417d1048e5afe73c8cca752fc369ed2
View file https://github.com/vpython/glowscript/blob/98805c68ee67d1db6b8c2b471f821ca2bf572df7/GlowScriptOffline/glowscript_libraries/RScompiler.3.2.min.js
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/vpython/glowscript/pull/225/files
lib/rapydscript/compiler.jshttps://github.com/vpython/glowscript/pull/225/files#diff-21eb8966935b010d58675f21c5bccddd4453bf04f265127cd4ed00cb5e20680e
View file https://github.com/vpython/glowscript/blob/98805c68ee67d1db6b8c2b471f821ca2bf572df7/lib/rapydscript/compiler.js
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/vpython/glowscript/pull/225/files
package/RScompiler.3.2.min.jshttps://github.com/vpython/glowscript/pull/225/files#diff-1e087fded8593149d31432ac69ef174d42b7b638de687c35459926f5160555ce
View file https://github.com/vpython/glowscript/blob/98805c68ee67d1db6b8c2b471f821ca2bf572df7/package/RScompiler.3.2.min.js
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/vpython/glowscript/pull/225/files
tests/test_compiler.pyhttps://github.com/vpython/glowscript/pull/225/files#diff-e34b71b4a9e5180dd896d166086e60748a08cfb8359021ec17d8ba5f8cb9bbd5
View file https://github.com/vpython/glowscript/blob/98805c68ee67d1db6b8c2b471f821ca2bf572df7/tests/test_compiler.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/vpython/glowscript/pull/225/{{ revealButtonHref }}
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.