Temporary Disabled. :) please Go back ⚓ T312528 Convert Grammar related javascript to php in texvcjs www.fgks.org » Address: [go: up one dir, main page] Include Form Remove Scripts Accept Cookies Show Images Show Referer Rotate13 Base64 Strip Meta Strip Title Session Cookies Page MenuHomePhabricatorSearchConfigure Global SearchLog InCreate Task Maniphest T312528 Convert Grammar related javascript to php in texvcjsClosed, ResolvedPublicActionsEdit TaskEdit Related Tasks...Create SubtaskEdit Parent TasksEdit SubtasksMerge Duplicates InClose As DuplicateEdit Related Objects...Edit CommitsEdit MocksSubscribeMute NotificationsProtect as security issueAward TokenFlag For LaterAssigned ToStegmujoAuthored ByStegmujoJul 7 2022, 11:25 AM2022-07-07 11:25:14 (UTC+0)TagsMath (Inbox)research-ideas (Backlog)Math-Non-WMF-InstallationsUser-Physikerwelt (Backlog)Texvcjs (Backlog)MW-1.39-notes (1.39.0-wmf.27; 2022-08-29)MW-1.40-notes (1.40.0-wmf.12; 2022-11-28)Referenced FilesF35541134: T312528_phpunit.patchSep 30 2022, 11:01 AM2022-09-30 11:01:23 (UTC+0)Subscribersakosiariscscottdom_walden• PcheloloPhysikerweltSalixAlbaStegmujoDescriptionphpeg and similar modules like wikipeg can not convert or read javascript in action blocks and introduction code of peg based grammar files. To enable conversion of LaTeX to MML in the future in texvcjs, the already existing functionalities in javascript have to be converted. To created a more readable form of the existing modules in php, understand the visitor-pattern and eventually use another pattern in the php based classes. Convert the node modules referenced in parser.pegjs to php and in the render functionality: texutil, render and ast shall be refactored with the new classbased-implmnentation. Convert the action blocks to php. Create a php based grammar and ensure its functionality. Write or convert some basic unit tests to check the functionality DetailsSubjectRepoBranchLines +/- Add beginning of RenderUtilmediawiki/extensions/Mathmaster+69 -0 Add Builder for creating Parser.phpmediawiki/extensions/Mathmaster+160 -1 Add Texutilmediawiki/extensions/Mathmaster+5 K -0Add final nodesmediawiki/extensions/Mathmaster+499 -43Add further nodesmediawiki/extensions/Mathmaster+1 K -3Add some basic nodes and texUtilmediawiki/extensions/Mathmaster+5 K -7 Add TexNodemediawiki/extensions/Mathmaster+293 -0 WIP: Convert Grammar related javascript to php in texvcjsmediawiki/extensions/Mathmaster+5 K -0Customize query in gerritRelated ObjectsSearch...Task GraphStatusSubtypeAssignedTask DeclinedStegmujoT310373 Make Mathoid Client a standalone class OpenNoneT327098 Implement Math Accessibility Features necessary for Intent attribute usage ResolvedPhysikerweltT302628 Implement native MathML rendering in Math ResolvedStegmujoT312528 Convert Grammar related javascript to php in texvcjs ResolvedStegmujoT315223 Create testrunner for running the Wikipedia tests locally with json file ResolvedStegmujoT315978 Reminder Final Checks in Implementation DuplicateNoneT316422 PHP Coding conventions: 3 Backlsashes? DeclinedNoneT316423 PHP Coding conventions: 3 Backslashes? OpenPhysikerweltT319521 Add Unicode test from tests/All.js and fix it in php DeclinedNoneT319522 Add Ocaml checks to AllTest.php OpenPhysikerweltT320964 Remove buildParserPHP regexes when phpeggy is fixed DeclinedNoneT321060 In TexVC PHP fix SyntaxError information ResolvedNoneT321262 Add More Types to TexVC PHP ResolvedStegmujoT321599 Improve Perfomance of TexVC PHP in Math ResolvedPhysikerweltT333973 performance: consider removing curly ResolvedStegmujoT323554 Change Validator to newDefaultValidator ResolvedPhysikerweltT332183 Fix Grammar for parsing operators with parentheses ResolvedStegmujoT346731 fix escaping not correct for "<" or ">" ResolvedBUG REPORTStegmujoT347320 CI test error: already defined testUnderbrace function ResolvedStegmujoT348936 Don't call trim(null) ResolvedStegmujoT348975 Implement a configuration flag which can choose rendering for chemistry formulas ResolvedStegmujoT348976 Add a cache purging action for url ResolvedStegmujoT317026 Implement Interface for Running TexVC in Mathextension PHPEvent TimelineStegmujo created this task.Jul 7 2022, 11:25 AM2022-07-07 11:25:14 (UTC+0)Stegmujo updated the task description. (Show Details)Jul 7 2022, 11:34 AM2022-07-07 11:34:42 (UTC+0)Physikerwelt added a comment.Jul 7 2022, 12:43 PM2022-07-07 12:43:40 (UTC+0)Comment ActionsTo created a more readable form of the existing modules in php, understand the visitor-pattern in MediaWiki and eventually use another pattern in the php based classes. With visitor pattern I was referring to https://en.wikipedia.org/wiki/Visitor_pattern . I don't think it is conceptually a bad thing, but maybe we can use something less custom. In PHP it is less common to generate classes without the class keyword. Something like https://refactoring.guru/design-patterns/visitor/php/example#example-1 . Maybe we could also refactor the current JS code to make use of explicit classes rather than using generic objects. See also the reference for the this keyword in JS https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/thisStegmujo updated the task description. (Show Details)Jul 8 2022, 8:20 AM2022-07-08 08:20:39 (UTC+0)Stegmujo updated the task description. (Show Details)Jul 8 2022, 8:48 AM2022-07-08 08:48:32 (UTC+0)Stegmujo updated the task description. (Show Details)Jul 8 2022, 10:13 AM2022-07-08 10:13:38 (UTC+0)Reedy unsubscribed.Jul 12 2022, 10:32 AM2022-07-12 10:32:16 (UTC+0)tstarling unsubscribed.Jul 21 2022, 2:46 AM2022-07-21 02:46:17 (UTC+0)gerritbot added a comment.Jul 26 2022, 3:20 PM2022-07-26 15:20:43 (UTC+0)Comment ActionsChange 817289 had a related patch set uploaded (by Stegmujo; author: Stegmujo): [mediawiki/extensions/Math@master] WIP: Convert Grammar related javascript to php in texvcjs https://gerrit.wikimedia.org/r/817289gerritbot added a project: Patch-For-Review.Jul 26 2022, 3:20 PM2022-07-26 15:20:43 (UTC+0)Stegmujo updated the task description. (Show Details)Jul 26 2022, 3:22 PM2022-07-26 15:22:49 (UTC+0)gerritbot added a comment.Aug 17 2022, 1:28 PM2022-08-17 13:28:52 (UTC+0)Comment ActionsChange 824207 had a related patch set uploaded (by Stegmujo; author: Stegmujo): [mediawiki/extensions/Math@master] Add TexNode and a test. https://gerrit.wikimedia.org/r/824207gerritbot added a comment.Aug 17 2022, 1:29 PM2022-08-17 13:29:19 (UTC+0)Comment ActionsChange 824208 had a related patch set uploaded (by Stegmujo; author: Stegmujo): [mediawiki/extensions/Math@master] Add beginning of RenderUtil and Test. https://gerrit.wikimedia.org/r/824208gerritbot added a comment.Aug 17 2022, 1:31 PM2022-08-17 13:31:45 (UTC+0)Comment ActionsChange 824211 had a related patch set uploaded (by Stegmujo; author: Stegmujo): [mediawiki/extensions/Math@master] Add some basic nodes. https://gerrit.wikimedia.org/r/824211gerritbot added a comment.Aug 17 2022, 1:31 PM2022-08-17 13:31:59 (UTC+0)Comment ActionsChange 824212 had a related patch set uploaded (by Stegmujo; author: Stegmujo): [mediawiki/extensions/Math@master] Add Texutil and a test. https://gerrit.wikimedia.org/r/824212gerritbot added a comment.Aug 17 2022, 4:00 PM2022-08-17 16:00:53 (UTC+0)Comment ActionsChange 817289 abandoned by Stegmujo: [mediawiki/extensions/Math@master] WIP: Convert Grammar related javascript to php in texvcjs Reason: https://gerrit.wikimedia.org/r/817289gerritbot added a comment.Aug 23 2022, 10:15 AM2022-08-23 10:15:47 (UTC+0)Comment ActionsChange 824207 merged by jenkins-bot: [mediawiki/extensions/Math@master] Add TexNode https://gerrit.wikimedia.org/r/824207ReleaseTaggerBot added a project: MW-1.39-notes (1.39.0-wmf.27; 2022-08-29).Aug 23 2022, 11:00 AM2022-08-23 11:00:40 (UTC+0)gerritbot added a comment.Aug 26 2022, 5:06 PM2022-08-26 17:06:29 (UTC+0)Comment ActionsChange 824211 merged by jenkins-bot: [mediawiki/extensions/Math@master] Add some basic nodes and texUtil https://gerrit.wikimedia.org/r/824211gerritbot added a comment.Aug 29 2022, 10:17 AM2022-08-29 10:17:58 (UTC+0)Comment ActionsChange 827463 had a related patch set uploaded (by Stegmujo; author: Stegmujo): [mediawiki/extensions/Math@master] Add further nodes https://gerrit.wikimedia.org/r/827463gerritbot added a comment.Sep 5 2022, 11:42 AM2022-09-05 11:42:57 (UTC+0)Comment ActionsChange 827463 merged by jenkins-bot: [mediawiki/extensions/Math@master] Add further nodes https://gerrit.wikimedia.org/r/827463gerritbot added a comment.Sep 5 2022, 12:34 PM2022-09-05 12:34:25 (UTC+0)Comment ActionsChange 829812 had a related patch set uploaded (by Stegmujo; author: Stegmujo): [mediawiki/extensions/Math@master] Add final nodes https://gerrit.wikimedia.org/r/829812gerritbot added a comment.Sep 6 2022, 1:58 PM2022-09-06 13:58:12 (UTC+0)Comment ActionsChange 829812 merged by jenkins-bot: [mediawiki/extensions/Math@master] Add final nodes https://gerrit.wikimedia.org/r/829812ReleaseTaggerBot added a project: MW-1.40-notes (1.40.0-wmf.1; 2022-09-12).Sep 6 2022, 2:00 PM2022-09-06 14:00:43 (UTC+0)gerritbot added a comment.Sep 6 2022, 2:05 PM2022-09-06 14:05:46 (UTC+0)Comment ActionsChange 830178 had a related patch set uploaded (by Stegmujo; author: Stegmujo): [mediawiki/extensions/Math@master] Add Parser https://gerrit.wikimedia.org/r/830178dom_walden subscribed.Sep 30 2022, 11:01 AM2022-09-30 11:01:23 (UTC+0)Comment Actions@Stegmujo I have been reviewing your patch. I have added more tests to the AllTests.php and converted it to use the dataProvider pattern rather than a foreach loop. It does take a while to run, though. Longer than the JS equivalent. I don't know why. There are a few failures and errors as well which I haven't had time to investigate yet. I also wrote a maintenance script where you can test the parser from the command line (based on bin/texvcjs). Patch below. If you like it, you can include it in your current patch or I can create a different patch. Whichever is easier for you. T312528_phpunit.patch24 KBDownloadStegmujo added a comment.Edited · Oct 6 2022, 1:25 PM2022-10-06 13:25:01 (UTC+0)Comment ActionsHey @dom_walden thanks for the patch for AllTests. I had a check with the current WIP state (https://gerrit.wikimedia.org/r/830178), and I applied the dataProvider from the patch instead of loop, great suggestion. I could fix all cases of the tests locally in WIP state (except the unicode testcase, skipped atm) through debugging the PHP grammar.gerritbot added a comment.Oct 10 2022, 3:03 PM2022-10-10 15:03:00 (UTC+0)Comment ActionsChange 824212 abandoned by Stegmujo: [mediawiki/extensions/Math@master] Add Texutil Reason: it is added in TexVC-PHP relation chain. https://gerrit.wikimedia.org/r/824212gerritbot added a comment.Oct 18 2022, 2:29 PM2022-10-18 14:29:20 (UTC+0)Comment ActionsChange 830178 merged by jenkins-bot: [mediawiki/extensions/Math@master] Add Builder for creating Parser.php https://gerrit.wikimedia.org/r/830178ReleaseTaggerBot edited projects, added MW-1.40-notes (1.40.0-wmf.7; 2022-10-24); removed MW-1.40-notes (1.40.0-wmf.1; 2022-09-12).Oct 18 2022, 3:00 PM2022-10-18 15:00:42 (UTC+0)ReleaseTaggerBot edited projects, added MW-1.40-notes (1.40.0-wmf.12; 2022-11-28); removed MW-1.40-notes (1.40.0-wmf.7; 2022-10-24).Nov 21 2022, 12:01 PM2022-11-21 12:01:02 (UTC+0)Stegmujo closed this task as Resolved.Jan 17 2023, 11:21 AM2023-01-17 11:21:09 (UTC+0)Stegmujo closed subtask T315223: Create testrunner for running the Wikipedia tests locally with json file as Resolved.Stegmujo closed subtask T317026: Implement Interface for Running TexVC in Mathextension PHP as Resolved.Jan 17 2023, 11:39 AM2023-01-17 11:39:04 (UTC+0)gerritbot added a comment.Feb 14 2023, 4:08 PM2023-02-14 16:08:01 (UTC+0)Comment ActionsChange 824208 abandoned by Stegmujo: [mediawiki/extensions/Math@master] Add beginning of RenderUtil Reason: already done somewhere else https://gerrit.wikimedia.org/r/824208Maintenance_bot removed a project: Patch-For-Review.Feb 14 2023, 4:10 PM2023-02-14 16:10:32 (UTC+0)Lens0021 unsubscribed.Feb 14 2023, 11:13 PM2023-02-14 23:13:11 (UTC+0)Stegmujo closed subtask T315978: Reminder Final Checks in Implementation as Resolved.Nov 30 2023, 9:35 AM2023-11-30 09:35:38 (UTC+0)Log In to Comment
phpeg and similar modules like wikipeg can not convert or read javascript in action blocks and introduction code of peg based grammar files.
To enable conversion of LaTeX to MML in the future in texvcjs, the already existing functionalities in javascript have to be converted.
To created a more readable form of the existing modules in php, understand the visitor-pattern and eventually use another pattern in the php based classes.
To created a more readable form of the existing modules in php, understand the visitor-pattern in MediaWiki and eventually use another pattern in the php based classes.
With visitor pattern I was referring to https://en.wikipedia.org/wiki/Visitor_pattern . I don't think it is conceptually a bad thing, but maybe we can use something less custom. In PHP it is less common to generate classes without the class keyword. Something like https://refactoring.guru/design-patterns/visitor/php/example#example-1 . Maybe we could also refactor the current JS code to make use of explicit classes rather than using generic objects. See also the reference for the this keyword in JS https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this
Change 817289 had a related patch set uploaded (by Stegmujo; author: Stegmujo):
[mediawiki/extensions/Math@master] WIP: Convert Grammar related javascript to php in texvcjs
https://gerrit.wikimedia.org/r/817289
Change 824207 had a related patch set uploaded (by Stegmujo; author: Stegmujo):
[mediawiki/extensions/Math@master] Add TexNode and a test.
https://gerrit.wikimedia.org/r/824207
Change 824208 had a related patch set uploaded (by Stegmujo; author: Stegmujo):
[mediawiki/extensions/Math@master] Add beginning of RenderUtil and Test.
https://gerrit.wikimedia.org/r/824208
Change 824211 had a related patch set uploaded (by Stegmujo; author: Stegmujo):
[mediawiki/extensions/Math@master] Add some basic nodes.
https://gerrit.wikimedia.org/r/824211
Change 824212 had a related patch set uploaded (by Stegmujo; author: Stegmujo):
[mediawiki/extensions/Math@master] Add Texutil and a test.
https://gerrit.wikimedia.org/r/824212
Change 817289 abandoned by Stegmujo:
Reason:
Change 824207 merged by jenkins-bot:
[mediawiki/extensions/Math@master] Add TexNode
Change 824211 merged by jenkins-bot:
[mediawiki/extensions/Math@master] Add some basic nodes and texUtil
Change 827463 had a related patch set uploaded (by Stegmujo; author: Stegmujo):
[mediawiki/extensions/Math@master] Add further nodes
https://gerrit.wikimedia.org/r/827463
Change 827463 merged by jenkins-bot:
Change 829812 had a related patch set uploaded (by Stegmujo; author: Stegmujo):
[mediawiki/extensions/Math@master] Add final nodes
https://gerrit.wikimedia.org/r/829812
Change 829812 merged by jenkins-bot:
Change 830178 had a related patch set uploaded (by Stegmujo; author: Stegmujo):
[mediawiki/extensions/Math@master] Add Parser
https://gerrit.wikimedia.org/r/830178
@Stegmujo I have been reviewing your patch.
I have added more tests to the AllTests.php and converted it to use the dataProvider pattern rather than a foreach loop. It does take a while to run, though. Longer than the JS equivalent. I don't know why. There are a few failures and errors as well which I haven't had time to investigate yet.
I also wrote a maintenance script where you can test the parser from the command line (based on bin/texvcjs).
Patch below. If you like it, you can include it in your current patch or I can create a different patch. Whichever is easier for you.
Hey @dom_walden thanks for the patch for AllTests. I had a check with the current WIP state (https://gerrit.wikimedia.org/r/830178), and I applied the dataProvider from the patch instead of loop, great suggestion. I could fix all cases of the tests locally in WIP state (except the unicode testcase, skipped atm) through debugging the PHP grammar.
Change 824212 abandoned by Stegmujo:
[mediawiki/extensions/Math@master] Add Texutil
it is added in TexVC-PHP relation chain.
Change 830178 merged by jenkins-bot:
[mediawiki/extensions/Math@master] Add Builder for creating Parser.php
Change 824208 abandoned by Stegmujo:
[mediawiki/extensions/Math@master] Add beginning of RenderUtil
already done somewhere else