Created
December 7, 2022 17:29
-
-
Save kwhinnery/ba177d0cdae261b560a163265466adc2 to your computer and use it in GitHub Desktop.
AST Parser for the 12 Days of Retool!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"uuid":"31a3f5d8-71c4-11ed-8183-8776d1b9fed0","page":{"id":111885406,"data":{"appState":"[\"~#iR\",[\"^ \",\"n\",\"appTemplate\",\"v\",[\"^ \",\"isFetching\",false,\"plugins\",[\"~#iOM\",[\"$main\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"$main\",\"type\",\"frame\",\"subtype\",\"Frame\",\"namespace\",null,\"resourceName\",null,\"resourceDisplayName\",null,\"template\",[\"^3\",[\"type\",\"main\",\"sticky\",false]],\"style\",[\"^3\",[]],\"position2\",null,\"mobilePosition2\",null,\"mobileAppPosition\",null,\"tabIndex\",null,\"container\",\"\",\"createdAt\",\"~m1669932298426\",\"updatedAt\",\"~m1669932298426\",\"folder\",\"\",\"screen\",null]]],\"$header\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"$header\",\"^4\",\"frame\",\"^5\",\"Frame\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"type\",\"header\",\"sticky\",true,\"isHiddenOnDesktop\",false,\"isHiddenOnMobile\",true]],\"^:\",[\"^3\",[]],\"^;\",null,\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",\"~m1669932373451\",\"^A\",\"~m1669932373451\",\"^B\",\"\",\"^C\",null]]],\"text1\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"text1\",\"^4\",\"widget\",\"^5\",\"TextWidget2\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"heightType\",\"auto\",\"horizontalAlign\",\"left\",\"hidden\",false,\"imageWidth\",\"fit\",\"showInEditor\",false,\"verticalAlign\",\"center\",\"tooltipText\",\"\",\"value\",\"# A Parser for an Abstract Syntax Tree\",\"disableMarkdown\",false,\"overflowType\",\"scroll\",\"maintainSpaceWhenHidden\",false]],\"^:\",[\"^3\",[]],\"^;\",[\"^0\",[\"^ \",\"n\",\"position2\",\"v\",[\"^ \",\"^?\",\"\",\"rowGroup\",\"body\",\"subcontainer\",\"header\",\"row\",0.3999999999999999,\"col\",1,\"height\",0.6,\"width\",11,\"tabNum\",0]]],\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",\"~m1669932383726\",\"^A\",\"~m1669932403740\",\"^B\",\"\",\"^C\",null]]],\"circularImage1\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"circularImage1\",\"^4\",\"widget\",\"^5\",\"ImageWidget2\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"heightType\",\"fixed\",\"horizontalAlign\",\"center\",\"srcWidth\",null,\"clickable\",false,\"src\",\"https://www.lifeinthefingerlakes.com/wp-content/uploads/2015/12/Bird-690x394.jpg\",\"hidden\",false,\"srcHeight\",null,\"showInEditor\",false,\"tooltipText\",\"\",\"fit\",\"contain\",\"style\",[\"^3\",[\"borderRadius\",\"50%\"]],\"aspectRatio\",1,\"storageBlobId\",\"\",\"altText\",\"\",\"dbBlobId\",\"\",\"events\",[\"^3\",[]],\"srcType\",\"src\",\"maintainSpaceWhenHidden\",false]],\"^:\",[\"^3\",[]],\"^;\",[\"^0\",[\"^ \",\"n\",\"position2\",\"v\",[\"^ \",\"^?\",\"\",\"^D\",\"body\",\"^E\",\"header\",\"row\",0,\"col\",0,\"^F\",2,\"^G\",1,\"^H\",0]]],\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",\"~m1669932447606\",\"^A\",\"~m1669932461136\",\"^B\",\"\",\"^C\",null]]],\"container1\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"container1\",\"^4\",\"widget\",\"^5\",\"ContainerWidget2\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"_disabledByIndex\",[\"~#iL\",[\"\"]],\"heightType\",\"fixed\",\"currentViewKey\",null,\"iconByIndex\",[],\"clickable\",false,\"_iconByIndex\",[\"^I\",[\"\"]],\"hidden\",false,\"showHeader\",true,\"hoistFetching\",true,\"views\",[],\"showInEditor\",false,\"tooltipText\",\"\",\"hiddenByIndex\",[],\"_hiddenByIndex\",[\"^I\",[\"\"]],\"currentViewIndex\",null,\"_hasMigratedNestedItems\",true,\"transition\",\"none\",\"itemMode\",\"static\",\"_tooltipByIndex\",[\"^I\",[\"\"]],\"tooltipByIndex\",[],\"showFooter\",true,\"_viewKeys\",[\"^I\",[\"View 1\"]],\"events\",[\"^3\",[]],\"_ids\",[\"^I\",[\"2deff\"]],\"viewKeys\",[],\"iconPositionByIndex\",[],\"_iconPositionByIndex\",[\"^I\",[\"\"]],\"hovered\",false,\"loading\",false,\"overflowType\",\"scroll\",\"disabled\",false,\"_labels\",[\"^I\",[\"\"]],\"disabledByIndex\",[],\"maintainSpaceWhenHidden\",false,\"showBody\",true,\"labels\",[]]],\"^:\",[\"^3\",[]],\"^;\",[\"^0\",[\"^ \",\"n\",\"position2\",\"v\",[\"^ \",\"^?\",\"\",\"^D\",\"body\",\"^E\",\"\",\"row\",1.0547118733938987e-15,\"col\",0,\"^F\",8.799999999999999,\"^G\",6,\"^H\",0]]],\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",\"~m1669932593265\",\"^A\",\"~m1670365732030\",\"^B\",\"\",\"^C\",null]]],\"containerTitle1\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"containerTitle1\",\"^4\",\"widget\",\"^5\",\"TextWidget2\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"heightType\",\"auto\",\"horizontalAlign\",\"left\",\"hidden\",false,\"imageWidth\",\"fit\",\"showInEditor\",false,\"verticalAlign\",\"center\",\"tooltipText\",\"\",\"value\",\"## JavaScript Code\",\"disableMarkdown\",false,\"overflowType\",\"scroll\",\"maintainSpaceWhenHidden\",false]],\"^:\",[\"^3\",[]],\"^;\",[\"^0\",[\"^ \",\"n\",\"position2\",\"v\",[\"^ \",\"^?\",\"container1\",\"^D\",\"header\",\"^E\",\"\",\"row\",0,\"col\",0,\"^F\",0.6,\"^G\",12,\"^H\",0]]],\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",\"~m1669932593390\",\"^A\",\"~m1669932605239\",\"^B\",\"\",\"^C\",null]]],\"codeTextArea\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"codeTextArea\",\"^4\",\"widget\",\"^5\",\"TextAreaWidget\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"spellCheck\",false,\"readOnly\",false,\"autoResize\",false,\"showCharacterCount\",false,\"autoComplete\",false,\"maxLength\",null,\"hidden\",false,\"customValidation\",\"\",\"hideValidationMessage\",false,\"minLines\",\"12\\n\",\"validationMessage\",\"\",\"showInEditor\",false,\"pattern\",\"\",\"tooltipText\",\"\",\"labelAlign\",\"left\",\"formDataKey\",\"{{ self.id }}\",\"value\",\"const foo = 'bar';\",\"labelCaption\",\"\",\"hideLabel\",true,\"labelWidth\",\"33\",\"autoFill\",\"\",\"placeholder\",\"const foo = 'bar';\",\"label\",\"Label\",\"_validate\",false,\"labelWidthUnit\",\"%\",\"invalid\",false,\"minLength\",null,\"inputTooltip\",\"\",\"events\",[\"^I\",[]],\"autoCapitalize\",\"none\",\"maxLines\",null,\"loading\",false,\"disabled\",false,\"labelPosition\",\"top\",\"labelWrap\",false,\"maintainSpaceWhenHidden\",false,\"required\",false]],\"^:\",[\"^3\",[]],\"^;\",[\"^0\",[\"^ \",\"n\",\"position2\",\"v\",[\"^ \",\"^?\",\"container1\",\"^D\",\"body\",\"^E\",\"2deff\",\"row\",0,\"col\",0,\"^F\",1,\"^G\",12,\"^H\",0]]],\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",\"~m1669932616481\",\"^A\",\"~m1670432098864\",\"^B\",\"\",\"^C\",null]]],\"container2\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"container2\",\"^4\",\"widget\",\"^5\",\"ContainerWidget2\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"_disabledByIndex\",[\"^I\",[\"\"]],\"heightType\",\"fixed\",\"currentViewKey\",null,\"iconByIndex\",[],\"clickable\",false,\"_iconByIndex\",[\"^I\",[\"\"]],\"hidden\",false,\"showHeader\",true,\"hoistFetching\",true,\"views\",[],\"showInEditor\",false,\"tooltipText\",\"\",\"hiddenByIndex\",[],\"_hiddenByIndex\",[\"^I\",[\"\"]],\"currentViewIndex\",null,\"_hasMigratedNestedItems\",true,\"transition\",\"none\",\"itemMode\",\"static\",\"_tooltipByIndex\",[\"^I\",[\"\"]],\"tooltipByIndex\",[],\"showFooter\",false,\"_viewKeys\",[\"^I\",[\"View 1\"]],\"events\",[\"^3\",[]],\"_ids\",[\"^I\",[\"2deff\"]],\"viewKeys\",[],\"iconPositionByIndex\",[],\"_iconPositionByIndex\",[\"^I\",[\"\"]],\"hovered\",false,\"loading\",false,\"overflowType\",\"scroll\",\"disabled\",false,\"_labels\",[\"^I\",[\"\"]],\"disabledByIndex\",[],\"maintainSpaceWhenHidden\",false,\"showBody\",true,\"labels\",[]]],\"^:\",[\"^3\",[]],\"^;\",[\"^0\",[\"^ \",\"n\",\"position2\",\"v\",[\"^ \",\"^?\",\"\",\"^D\",\"body\",\"^E\",\"\",\"row\",1.6653345369377348e-16,\"col\",6,\"^F\",8.799999999999999,\"^G\",6,\"^H\",0]]],\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",\"~m1669932705669\",\"^A\",\"~m1669932705669\",\"^B\",\"\",\"^C\",null]]],\"containerTitle2\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"containerTitle2\",\"^4\",\"widget\",\"^5\",\"TextWidget2\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"heightType\",\"auto\",\"horizontalAlign\",\"left\",\"hidden\",false,\"imageWidth\",\"fit\",\"showInEditor\",false,\"verticalAlign\",\"center\",\"tooltipText\",\"\",\"value\",\"## AST Structure\",\"disableMarkdown\",false,\"overflowType\",\"scroll\",\"maintainSpaceWhenHidden\",false]],\"^:\",[\"^3\",[]],\"^;\",[\"^0\",[\"^ \",\"n\",\"position2\",\"v\",[\"^ \",\"^?\",\"container2\",\"^D\",\"header\",\"^E\",\"\",\"row\",0,\"col\",0,\"^F\",0.6,\"^G\",7,\"^H\",0]]],\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",\"~m1669932705824\",\"^A\",\"~m1669932760470\",\"^B\",\"\",\"^C\",null]]],\"text2\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"text2\",\"^4\",\"widget\",\"^5\",\"TextWidget2\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"heightType\",\"auto\",\"horizontalAlign\",\"left\",\"hidden\",false,\"imageWidth\",\"fit\",\"showInEditor\",false,\"verticalAlign\",\"center\",\"tooltipText\",\"\",\"value\",\"**AST created with [acorn](https://github.com/acornjs/acorn)**\",\"disableMarkdown\",false,\"overflowType\",\"scroll\",\"maintainSpaceWhenHidden\",false]],\"^:\",[\"^3\",[]],\"^;\",[\"^0\",[\"^ \",\"n\",\"position2\",\"v\",[\"^ \",\"^?\",\"container1\",\"^D\",\"footer\",\"^E\",\"\",\"row\",0.20000000000000018,\"col\",0,\"^F\",0.6,\"^G\",4,\"^H\",0]]],\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",\"~m1669932783237\",\"^A\",\"~m1670365808724\",\"^B\",\"\",\"^C\",null]]],\"button1\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"button1\",\"^4\",\"widget\",\"^5\",\"ButtonWidget2\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"horizontalAlign\",\"stretch\",\"clickable\",false,\"iconAfter\",\"\",\"submitTargetId\",null,\"hidden\",false,\"text\",\"Generate AST\",\"showInEditor\",false,\"tooltipText\",\"\",\"styleVariant\",\"solid\",\"submit\",false,\"iconBefore\",\"\",\"events\",[\"^I\",[[\"^3\",[\"event\",\"click\",\"type\",\"script\",\"method\",\"run\",\"pluginId\",\"\",\"targetId\",null,\"params\",[\"^3\",[\"src\",\"const ast = acorn.parse(codeTextArea.value);\\n\\nastObject.setValue(ast);\"]],\"waitType\",\"debounce\",\"waitMs\",\"0\"]]]],\"loading\",false,\"loaderPosition\",\"auto\",\"disabled\",false,\"maintainSpaceWhenHidden\",false]],\"^:\",[\"^3\",[]],\"^;\",[\"^0\",[\"^ \",\"n\",\"position2\",\"v\",[\"^ \",\"^?\",\"container1\",\"^D\",\"footer\",\"^E\",\"\",\"row\",0,\"col\",9,\"^F\",1,\"^G\",3,\"^H\",0]]],\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",\"~m1670365760957\",\"^A\",\"~m1670422750758\",\"^B\",\"\",\"^C\",null]]],\"astObject\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"astObject\",\"^4\",\"state\",\"^5\",\"State\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"_persistedValueGetter\",null,\"_persistedValueSetter\",null,\"persistValue\",false,\"persistedValueKey\",\"\",\"value\",\"{ todo: 'enter some JavaScript code on the right!' }\"]],\"^:\",null,\"^;\",null,\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",\"~m1670365943595\",\"^A\",\"~m1670365970560\",\"^B\",\"\",\"^C\",null]]],\"jsonExplorer1\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"jsonExplorer1\",\"^4\",\"widget\",\"^5\",\"JSONExplorerWidget\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"value\",\"{{ astObject.value }}\",\"html\",false,\"expandNodes\",true]],\"^:\",[\"^3\",[]],\"^;\",[\"^0\",[\"^ \",\"n\",\"position2\",\"v\",[\"^ \",\"^?\",\"container2\",\"^D\",\"body\",\"^E\",\"2deff\",\"row\",0,\"col\",0,\"^F\",6.8,\"^G\",12,\"^H\",0]]],\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",\"~m1670422794847\",\"^A\",\"~m1670422867274\",\"^B\",\"\",\"^C\",null]]]]],\"^@\",null,\"version\",\"2.105.0\",\"appThemeId\",null,\"preloadedAppJavaScript\",null,\"preloadedAppJSLinks\",[\"https://cdnjs.cloudflare.com/ajax/libs/acorn/8.7.1/acorn.min.js\"],\"testEntities\",[],\"tests\",[],\"appStyles\",\"\",\"responsiveLayoutDisabled\",false,\"loadingIndicatorsDisabled\",false,\"urlFragmentDefinitions\",[\"^I\",[]],\"pageLoadValueOverrides\",[\"^I\",[]],\"customDocumentTitle\",\"\",\"customDocumentTitleEnabled\",false,\"customShortcuts\",[],\"isGlobalWidget\",false,\"isMobileApp\",false,\"multiScreenMobileApp\",false,\"mobileAppSettings\",[\"^ \",\"mobileOfflineModeEnabled\",false],\"folders\",[\"^I\",[]],\"queryStatusVisibility\",false,\"markdownLinkBehavior\",\"auto\",\"inAppRetoolPillAppearance\",\"NO_OVERRIDE\",\"rootScreen\",null,\"instrumentationEnabled\",false,\"experimentalPerfFeatures\",[\"^ \",\"batchCommitModelEnabled\",false,\"skipDepCycleCheckingEnabled\",false,\"serverDepGraphEnabled\",false,\"useRuntimeV2\",false],\"experimentalStabilityFeatures\",[\"^ \",\"lockModelForUpdates\",false],\"experimentalDataTabEnabled\",true]]]"},"changesRecord":[{"type":"UPDATE_PRELOADED_APP_JS_LINKS"}],"gitSha":null,"checksum":null,"createdAt":"2022-12-07T16:55:15.622Z","updatedAt":"2022-12-07T16:55:15.622Z","pageId":1633989,"userId":348139,"branchId":null},"modules":{}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment