René's URL Explorer Experiment


Title: replacing ly.slexer and ly.lex · Issue #139 · frescobaldi/python-ly · GitHub

Open Graph Title: replacing ly.slexer and ly.lex · Issue #139 · frescobaldi/python-ly

X Title: replacing ly.slexer and ly.lex · Issue #139 · frescobaldi/python-ly

Description: (related to #3, #55, and possibly others). Dear Friends, on the Salzburg conference I announced that I am writing a new lexer that wil replace ly.slexer and the ly.lex.xxx definition modules. The reason is that it is almost impossible to...

Open Graph Description: (related to #3, #55, and possibly others). Dear Friends, on the Salzburg conference I announced that I am writing a new lexer that wil replace ly.slexer and the ly.lex.xxx definition modules. The r...

X Description: (related to #3, #55, and possibly others). Dear Friends, on the Salzburg conference I announced that I am writing a new lexer that wil replace ly.slexer and the ly.lex.xxx definition modules. The r...

Opengraph URL: https://github.com/frescobaldi/python-ly/issues/139

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"replacing ly.slexer and ly.lex","articleBody":"(related to #3, #55, and possibly others).\r\n\r\nDear Friends,\r\n\r\non the Salzburg conference I announced that I am writing a new lexer that wil replace ``ly.slexer`` and the ``ly.lex.xxx`` definition modules.\r\n\r\nThe reason is that it is almost impossible to inherit from, say, ``ly.lex.lilypond`` to implement small changes in lexing between versions of LilyPond, because when one changes a class, all references still point to the old one. Also, the tokens generated by the slexer module are instances of different classes, making it necessary to import the lexing definitions to be able to refer to classes and e.g. find instances. And finally, the linear structure of the tokens in the current ``ly`` module makes it tedious to find ranges in a text where e.g. a certain parser state is active (e.g. find the start of a lyrics expression, etc). ``ly.document.Source`` and ``Runner`` try to adress that a little but basically they are a PITA to work with (I can say that because I wrote them 7 years ago:-) )\r\n\r\nThe module that will replace ``ly.slexer`` and ``ly.lex`` will be a generic parsing package which I'm writing right now; I first called it LiveLex, but because that coincides with a German company name, I renamed it ``parce``.\r\n\r\n``parce`` addresses all of the aforementioned shortcomings:\r\n\r\n* A language definition is just a very simple class instead of a module global namespace. What ``slexer`` calls a ``Parser`` (or a context) is a lexicon (which is basically a class method yielding the parsing rules).\r\n  It is very simple to inherit from a language definition and override just one lexicon to make a few adjustments. Because a lexicon is basically a class method, targets in other lexicons automatically refer to the inherited version of the lexicon. So supporting multiple versions of LilyPond becomes possible.\r\n* What ``slexer`` calls a Token instance is a token, but the \"type\" is stored in an ``action`` attribute. So there are no classes anymore for every possible token, and manipulating tokens does not require one to import a language module to get all the definitions. And all the ``isinstance(token, ly.lex.lilypond.BlaBla)`` calls can go!\r\n* Instead of a linear stream, the ``parce`` module creates a tree structure of the tokens, nested in contexts, and can update the structure when the user types in the document. So starting from a token, it is as simple as accessing its ``parent`` attribute to get the encompassing context. You can easily navigate to sibling or child tokens and there is a very powerful ``query`` method on every node, to search for anything in the tree structure.\r\n\r\nThis ``parce`` package already works very well, and I created good quality documentation and a web site for it, see https://parce.info/ . To get an idea of what a language definition looks like, compare [ly.lex.lilypond](https://github.com/frescobaldi/python-ly/blob/master/ly/lex/lilypond.py) (1659 lines) with [parce.lang.lilypond](https://github.com/wbsoft/parce/blob/master/parce/lang/lilypond.py) (currently 534 lines).\r\n\r\nParsing and updating can be done in a background thread. There is already a small package bringing ``parce`` to Qt's QTextDocument, which can be used later to enable highlighting of text in Frescobaldi using the new lexer.\r\n\r\nRight now, in ``ly`` and Frescobaldi, the music manipulation functionality uses either plain ``slexer`` tokens (such as the rhythm functions) or the ``ly.music`` tree structure. But also code such as the MusicXml output uses both the Music tree and also the original tokens.\r\n\r\nBoth can be ported to the new parser/lexer. But because that causes a rewrite of almost the whole of the ``ly`` package, I propose to create a new package from scratch, providing the same (and more) functionality, and that can be developed until the moment that it is possible to port Frescobaldi to it.\r\n\r\nIt is still desirable to have a tree structure like ``ly.music``, but now the ``parce`` tree structure can probably form a solid base of such a structure.\r\n\r\n(How/whether ``parce`` can support a custom data structure attached to a ``parce`` tree is yet to be determined. But we could also opt for an independent tree, which can replace ``ly.music`` and, while at it, also has a simpler structure (with fewer classes as current ``ly.music``).  Because ``parce`` can exactly report which part of the tree got updated, it is easy to invalidate just the modified part of a music tree instead of rebuilding it completely after every change, as is the case now.)\r\n\r\nSo, we could think of a name for the new ly module. We could use ``ly2`` but I don't like the number in the name. I am currently thinking of ``quickly``. :-)","author":{"url":"https://github.com/wbsoft","@type":"Person","name":"wbsoft"},"datePublished":"2020-03-27T13:25:35Z","url":"https://github.com/frescobaldi/python-ly/issues/139"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d9de4214-cb72-5557-f12f-2d5aad3afadb
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB0AA:101EA3:C62619:1063AC8:6B09B6F4
html-safe-nonce4e53e32820f7a3e06c51b1f5cbdc4e9f0c177b16fff7918b6d7761c097400834
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEFBOjEwMUVBMzpDNjI2MTk6MTA2M0FDODo2QjA5QjZGNCIsInZpc2l0b3JfaWQiOiI4NzI2MTk4NTU1ODg0NzYyODY4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac48d4ea70ee0bd7df379d65cd9150ff3f46682edb7bef9e580384ec1b2424d48d
hovercard-subject-tagissue:589131943
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/frescobaldi/python-ly/139/issue_layout
twitter:imagehttps://opengraph.githubassets.com/dee34166da317e97637dc6b9bce2a0f60b2ff12e99332239eb7c5934a6742b99/frescobaldi/python-ly/issues/139
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/dee34166da317e97637dc6b9bce2a0f60b2ff12e99332239eb7c5934a6742b99/frescobaldi/python-ly/issues/139
og:image:alt(related to #3, #55, and possibly others). Dear Friends, on the Salzburg conference I announced that I am writing a new lexer that wil replace ly.slexer and the ly.lex.xxx definition modules. The r...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamewbsoft
hostnamegithub.com
expected-hostnamegithub.com
None29e6866c4c5b6697a062df08d37fa80bbfb75810ca4280c0d277f04956012d39
turbo-cache-controlno-preview
go-importgithub.com/frescobaldi/python-ly git https://github.com/frescobaldi/python-ly.git
octolytics-dimension-user_id19853952
octolytics-dimension-user_loginfrescobaldi
octolytics-dimension-repository_id29728425
octolytics-dimension-repository_nwofrescobaldi/python-ly
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id29728425
octolytics-dimension-repository_network_root_nwofrescobaldi/python-ly
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee72aac8801621433bb0313888fbbe243f5998abc
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/frescobaldi/python-ly/issues/139#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffrescobaldi%2Fpython-ly%2Fissues%2F139
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%2Ffrescobaldi%2Fpython-ly%2Fissues%2F139
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=frescobaldi%2Fpython-ly
Reloadhttps://github.com/frescobaldi/python-ly/issues/139
Reloadhttps://github.com/frescobaldi/python-ly/issues/139
Reloadhttps://github.com/frescobaldi/python-ly/issues/139
frescobaldihttps://github.com/frescobaldi
python-lyhttps://github.com/frescobaldi/python-ly
Codehttps://github.com/frescobaldi/python-ly
Issues44 (44)https://github.com/frescobaldi/python-ly/issues
Pull requests22 (22)https://github.com/frescobaldi/python-ly/pulls
Actionshttps://github.com/frescobaldi/python-ly/actions
Projectshttps://github.com/frescobaldi/python-ly/projects
Wikihttps://github.com/frescobaldi/python-ly/wiki
Security and qualityhttps://github.com/frescobaldi/python-ly/security
Insightshttps://github.com/frescobaldi/python-ly/insights
https://github.com/frescobaldi/python-ly
New issuehttps://github.com/login?return_to=https://github.com/frescobaldi/python-ly/issues/139
New issuehttps://github.com/login?return_to=https://github.com/frescobaldi/python-ly/issues/139
replacing ly.slexer and ly.lexhttps://github.com/frescobaldi/python-ly/issues/139#top
https://github.com/wbsoft
discussionhttps://github.com/frescobaldi/python-ly/issues?q=state%3Aopen%20label%3A%22discussion%22
https://github.com/wbsoft
wbsofthttps://github.com/wbsoft
on Mar 27, 2020https://github.com/frescobaldi/python-ly/issues/139#issue-589131943
#3https://github.com/frescobaldi/python-ly/issues/3
#55https://github.com/frescobaldi/python-ly/issues/55
https://parce.info/https://parce.info/
ly.lex.lilypondhttps://github.com/frescobaldi/python-ly/blob/master/ly/lex/lilypond.py
parce.lang.lilypondhttps://github.com/wbsoft/parce/blob/master/parce/lang/lilypond.py
wbsofthttps://github.com/wbsoft
discussionhttps://github.com/frescobaldi/python-ly/issues?q=state%3Aopen%20label%3A%22discussion%22
on Mar 27, 2020https://github.com/frescobaldi/python-ly/issues/139#event-3172385305
wbsofthttps://github.com/wbsoft
on Mar 27, 2020https://github.com/frescobaldi/python-ly/issues/139#event-3172385340
https://github.com/wbsoft
wbsofthttps://github.com/wbsoft
on Mar 27, 2020https://github.com/frescobaldi/python-ly/issues/139#issuecomment-605325388
https://user-images.githubusercontent.com/588454/77802415-18591100-707b-11ea-9281-65e1d2e288ff.png
parceqthttps://github.com/wbsoft/parceqt
https://github.com/dliessi
dliessihttps://github.com/dliessi
on Mar 29, 2020https://github.com/frescobaldi/python-ly/issues/139#issuecomment-605635608
https://github.com/PaulMorris
PaulMorrishttps://github.com/PaulMorris
on Mar 30, 2020https://github.com/frescobaldi/python-ly/issues/139#issuecomment-606100207
https://github.com/wbsoft
wbsofthttps://github.com/wbsoft
on Mar 31, 2020https://github.com/frescobaldi/python-ly/issues/139#issuecomment-606495016
https://github.com/wbsoft
wbsofthttps://github.com/wbsoft
on May 22, 2020https://github.com/frescobaldi/python-ly/issues/139#issuecomment-632879544
parcehttps://parce.info/
Sign up for freehttps://github.com/signup?return_to=https://github.com/frescobaldi/python-ly/issues/139
Sign in to commenthttps://github.com/login?return_to=https://github.com/frescobaldi/python-ly/issues/139
wbsofthttps://github.com/wbsoft
discussionhttps://github.com/frescobaldi/python-ly/issues?q=state%3Aopen%20label%3A%22discussion%22
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.