├── style ├── base.css ├── index.js └── index.css ├── jupyterlab_stata_highlight2 ├── _version.py └── __init__.py ├── setup.py ├── install.json ├── MANIFEST.in ├── binder ├── environment.yml └── postBuild ├── .github └── workflows │ └── build.yml ├── LICENSE ├── lib ├── index.js └── stata.js ├── package.json ├── .gitignore ├── README.md └── pyproject.toml /style/base.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /style/index.css: -------------------------------------------------------------------------------- 1 | @import url('base.css'); 2 | -------------------------------------------------------------------------------- /jupyterlab_stata_highlight2/_version.py: -------------------------------------------------------------------------------- 1 | __version__ = "0.1.1" 2 | 3 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # setup.py shim for use with applications that require it. 2 | __import__("setuptools").setup() 3 | -------------------------------------------------------------------------------- /install.json: -------------------------------------------------------------------------------- 1 | { 2 | "packageManager": "python", 3 | "packageName": "jupyterlab_stata_highlight2", 4 | "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_stata_highlight2" 5 | } 6 | -------------------------------------------------------------------------------- /jupyterlab_stata_highlight2/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | import json 3 | from pathlib import Path 4 | 5 | from ._version import __version__ 6 | 7 | HERE = Path(__file__).parent.resolve() 8 | 9 | with (HERE / "labextension" / "package.json").open() as fid: 10 | data = json.load(fid) 11 | 12 | def _jupyter_labextension_paths(): 13 | return [{ 14 | "src": "labextension", 15 | "dest": data["name"] 16 | }] 17 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include *.md 3 | include pyproject.toml 4 | 5 | include package.json 6 | include install.json 7 | include ts*.json 8 | include yarn.lock 9 | 10 | graft jupyterlab_stata_highlight2/labextension 11 | 12 | # Javascript files 13 | graft lib 14 | graft style 15 | prune **/node_modules 16 | 17 | # Patterns to exclude from any directory 18 | global-exclude *~ 19 | global-exclude *.pyc 20 | global-exclude *.pyo 21 | global-exclude .git 22 | global-exclude .ipynb_checkpoints 23 | -------------------------------------------------------------------------------- /binder/environment.yml: -------------------------------------------------------------------------------- 1 | # a mybinder.org-ready environment for demoing jupyterlab_stata_highlight2 2 | # this environment may also be used locally on Linux/MacOS/Windows, e.g. 3 | # 4 | # conda env update --file binder/environment.yml 5 | # conda activate jupyterlab_stata_highlight2-demo 6 | # 7 | name: jupyterlab_stata_highlight2-demo 8 | 9 | channels: 10 | - conda-forge 11 | 12 | dependencies: 13 | # runtime dependencies 14 | - python >=3.8,<3.9.0a0 15 | - jupyterlab >=3,<4.0.0a0 16 | # labextension build dependencies 17 | - nodejs >=14,<15 18 | - pip 19 | - wheel 20 | # additional packages for demos 21 | # - ipywidgets 22 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: master 6 | pull_request: 7 | branches: '*' 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v2 16 | - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 17 | - name: Install dependencies 18 | run: python -m pip install -U jupyterlab~=3.0 jupyter_packaging~=0.10 19 | - name: Build the extension 20 | run: | 21 | python -m pip install -e . 22 | jupyter labextension list 2>&1 | grep -ie "jupyterlab_stata_highlight2.*OK" 23 | python -m jupyterlab.browser_check 24 | pip uninstall -y myextension 25 | pip install -v -e . 26 | jupyter labextension develop . --overwrite 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | Copyright (c) 2022, Tim Huegerich 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | 11 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | import { stata_mode } from './stata.js'; 2 | import { ICodeMirror } from '@jupyterlab/codemirror'; 3 | 4 | export default [ 5 | { 6 | id: 'jupyterlab_stata_highlight2', 7 | autoStart: true, 8 | requires: [ICodeMirror], 9 | activate: function (app, codeMirror) { 10 | console.log( 11 | 'JupyterLab extension jupyterlab_stata_highlight2 is activated-03!' 12 | ); 13 | console.log(app.commands); 14 | registerStataFileType(app); 15 | console.log( 16 | 'JupyterLab extension jupyterlab_stata_highlight2 end' 17 | ); 18 | codeMirror.CodeMirror.defineSimpleMode("stata", stata_mode); 19 | codeMirror.CodeMirror.defineMIME('text/x-stata', 'stata'); 20 | codeMirror.CodeMirror.defineMIME('text/stata', 'stata'); 21 | codeMirror.CodeMirror.modeInfo.push({ 22 | ext: ['do', 'ado'], 23 | mime: "text/x-stata", 24 | mode: 'stata', 25 | name: 'Stata' 26 | }); 27 | } 28 | } 29 | ]; 30 | 31 | function registerStataFileType(app) { 32 | app.docRegistry.addFileType({ 33 | name: 'stata', 34 | displayName: 'Stata', 35 | extensions: ['do', 'ado'], 36 | mimeTypes: ['text/x-stata'], 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /binder/postBuild: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ perform a development install of jupyterlab_stata_highlight2 3 | 4 | On Binder, this will run _after_ the environment has been fully created from 5 | the environment.yml in this directory. 6 | 7 | This script should also run locally on Linux/MacOS/Windows: 8 | 9 | python3 binder/postBuild 10 | """ 11 | import subprocess 12 | import sys 13 | from pathlib import Path 14 | 15 | 16 | ROOT = Path.cwd() 17 | 18 | def _(*args, **kwargs): 19 | """ Run a command, echoing the args 20 | 21 | fails hard if something goes wrong 22 | """ 23 | print("\n\t", " ".join(args), "\n") 24 | return_code = subprocess.call(args, **kwargs) 25 | if return_code != 0: 26 | print("\nERROR", return_code, " ".join(args)) 27 | sys.exit(return_code) 28 | 29 | # verify the environment is self-consistent before even starting 30 | _(sys.executable, "-m", "pip", "check") 31 | 32 | # install the labextension 33 | _(sys.executable, "-m", "pip", "install", "-e", ".") 34 | 35 | # verify the environment the extension didn't break anything 36 | _(sys.executable, "-m", "pip", "check") 37 | 38 | # list the extensions 39 | _("jupyter", "server", "extension", "list") 40 | 41 | # initially list installed extensions to determine if there are any surprises 42 | _("jupyter", "labextension", "list") 43 | 44 | 45 | print("JupyterLab with jupyterlab_stata_highlight2 is ready to run with:\n") 46 | print("\tjupyter lab\n") 47 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jupyterlab_stata_highlight2", 3 | "version": "0.1.2", 4 | "description": "JupyterLab extension for Stata syntax highlighting similar to the Stata IDE's.", 5 | "keywords": [ 6 | "jupyter", 7 | "jupyterlab", 8 | "jupyterlab-extension" 9 | ], 10 | "homepage": "https://github.com/hugetim/jupyterlab_stata_highlight2", 11 | "bugs": { 12 | "url": "https://github.com/hugetim/jupyterlab_stata_highlight2/issues" 13 | }, 14 | "license": "MIT", 15 | "author": { 16 | "name": "Tim Huegerich", 17 | "email": "hugetim@gmail.com" 18 | }, 19 | "files": [ 20 | "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}", 21 | "style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf}" 22 | ], 23 | "main": "lib/index.js", 24 | "style": "style/index.css", 25 | "repository": { 26 | "type": "git", 27 | "url": "https://github.com/hugetim/jupyterlab_stata_highlight2.git" 28 | }, 29 | "scripts": { 30 | "build": "npm run build:labextension:dev", 31 | "build:prod": "npm run build:labextension", 32 | "build:labextension": "jupyter labextension build .", 33 | "build:labextension:dev": "jupyter labextension build --development True .", 34 | "clean:labextension": "rimraf jupyterlab_stata_highlight2/labextension", 35 | "clean:all": "npm run clean:labextension", 36 | "prepare": "npm run build:prod", 37 | "watch": "npm run watch:labextension", 38 | "watch:labextension": "jupyter labextension watch ." 39 | }, 40 | "dependencies": { 41 | "@jupyterlab/codemirror": "*" 42 | }, 43 | "devDependencies": { 44 | "@jupyterlab/builder": "^3.5.2", 45 | "rimraf": "^3.0.2" 46 | }, 47 | "sideEffects": [ 48 | "style/*.css", 49 | "style/index.js" 50 | ], 51 | "styleModule": "style/index.js", 52 | "jupyterlab": { 53 | "extension": true, 54 | "outputDir": "jupyterlab_stata_highlight2/labextension" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.bundle.* 2 | node_modules/ 3 | *.egg-info/ 4 | .ipynb_checkpoints 5 | *.tsbuildinfo 6 | jupyterlab_stata_highlight2/labextension 7 | 8 | # Created by https://www.gitignore.io/api/python 9 | # Edit at https://www.gitignore.io/?templates=python 10 | 11 | ### Python ### 12 | # Byte-compiled / optimized / DLL files 13 | __pycache__/ 14 | *.py[cod] 15 | *$py.class 16 | 17 | # C extensions 18 | *.so 19 | 20 | # Distribution / packaging 21 | .Python 22 | build/ 23 | develop-eggs/ 24 | dist/ 25 | downloads/ 26 | eggs/ 27 | .eggs/ 28 | lib64/ 29 | parts/ 30 | sdist/ 31 | var/ 32 | wheels/ 33 | pip-wheel-metadata/ 34 | share/python-wheels/ 35 | .installed.cfg 36 | *.egg 37 | MANIFEST 38 | 39 | # PyInstaller 40 | # Usually these files are written by a python script from a template 41 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 42 | *.manifest 43 | *.spec 44 | 45 | # Installer logs 46 | pip-log.txt 47 | pip-delete-this-directory.txt 48 | 49 | # Unit test / coverage reports 50 | htmlcov/ 51 | .tox/ 52 | .nox/ 53 | .coverage 54 | .coverage.* 55 | .cache 56 | nosetests.xml 57 | coverage.xml 58 | *.cover 59 | .hypothesis/ 60 | .pytest_cache/ 61 | 62 | # Translations 63 | *.mo 64 | *.pot 65 | 66 | # Scrapy stuff: 67 | .scrapy 68 | 69 | # Sphinx documentation 70 | docs/_build/ 71 | 72 | # PyBuilder 73 | target/ 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Spyder project settings 85 | .spyderproject 86 | .spyproject 87 | 88 | # Rope project settings 89 | .ropeproject 90 | 91 | # Mr Developer 92 | .mr.developer.cfg 93 | .project 94 | .pydevproject 95 | 96 | # mkdocs documentation 97 | /site 98 | 99 | # mypy 100 | .mypy_cache/ 101 | .dmypy.json 102 | dmypy.json 103 | 104 | # Pyre type checker 105 | .pyre/ 106 | 107 | # End of https://www.gitignore.io/api/python 108 | 109 | # OSX files 110 | .DS_Store 111 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jupyterlab_stata_highlight2 2 | 3 | ![Github Actions Status](https://github.com/hugetim/jupyterlab_stata_highlight2/workflows/Build/badge.svg) 4 | 5 | JupyterLab extension for Stata syntax highlighting similar to the Stata IDE's. 6 | 7 | ## Requirements 8 | 9 | * JupyterLab >= 3.1, < 4.0 10 | 11 | ## Install 12 | 13 | ```bash 14 | pip install jupyterlab_stata_highlight2 15 | ``` 16 | 17 | ### Uninstall 18 | 19 | ```bash 20 | pip uninstall jupyterlab_stata_highlight2 21 | ``` 22 | 23 | ## Contributing 24 | 25 | ### Development install 26 | 27 | Note: You will need NodeJS to build the extension package. 28 | 29 | The `jlpm` command is JupyterLab's pinned version of 30 | [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use 31 | `yarn` or `npm` in lieu of `jlpm` below. 32 | 33 | ```bash 34 | # Clone the repo to your local environment 35 | # Change directory to the jupyterlab_stata_highlight2 directory 36 | # Install package in development mode 37 | pip install -e . 38 | # Link your development version of the extension with JupyterLab 39 | jupyter labextension develop . --overwrite 40 | # Rebuild extension Typescript source after making changes 41 | jlpm run build 42 | ``` 43 | 44 | You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension. 45 | 46 | ```bash 47 | # Watch the source directory in one terminal, automatically rebuilding when needed 48 | jlpm run watch 49 | # Run JupyterLab in another terminal 50 | jupyter lab 51 | ``` 52 | 53 | With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt). 54 | 55 | By default, the `jlpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command: 56 | 57 | ```bash 58 | jupyter lab build --minimize=False 59 | ``` 60 | 61 | ## Predecessor license notices 62 | Extension boilerplate originated in Project Jupyter's https://github.com/jupyterlab/extension-cookiecutter-js 63 | Extension content forked from Kyle Barron's https://github.com/kylebarron/jupyterlab-stata-highlight 64 | Please note their respective licenses. 65 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "hatchling>=1.3.1", 4 | "jupyterlab>=3.1, <4", 5 | ] 6 | build-backend = "hatchling.build" 7 | 8 | [project] 9 | name = "jupyterlab_stata_highlight2" 10 | description = "JupyterLab extension for Stata syntax highlighting similar to the Stata IDE's." 11 | readme = "README.md" 12 | requires-python = ">=3.7" 13 | authors = [ 14 | { name = "Tim Huegerich", email = "hugetim@gmail.com" }, 15 | ] 16 | keywords = [ 17 | "Jupyter", 18 | "JupyterLab", 19 | "JupyterLab3", 20 | ] 21 | classifiers = [ 22 | "Framework :: Jupyter", 23 | "Framework :: Jupyter :: JupyterLab", 24 | "Framework :: Jupyter :: JupyterLab :: 3", 25 | "Framework :: Jupyter :: JupyterLab :: Extensions", 26 | "Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt", 27 | "License :: OSI Approved :: MIT License", 28 | "Programming Language :: Python", 29 | "Programming Language :: Python :: 3", 30 | "Programming Language :: Python :: 3.7", 31 | "Programming Language :: Python :: 3.8", 32 | "Programming Language :: Python :: 3.9", 33 | "Programming Language :: Python :: 3.10", 34 | ] 35 | version = "0.1.2" 36 | 37 | [project.license] 38 | file = "LICENSE" 39 | 40 | [project.urls] 41 | Homepage = "https://github.com/hugetim/jupyterlab_stata_highlight2" 42 | 43 | [tool.hatch.build] 44 | artifacts = [ 45 | "jupyterlab_stata_highlight2/labextension", 46 | ] 47 | 48 | [tool.hatch.build.targets.wheel.shared-data] 49 | "jupyterlab_stata_highlight2/labextension/static" = "share/jupyter/labextensions/jupyterlab_stata_highlight2/static" 50 | "install.json" = "share/jupyter/labextensions/jupyterlab_stata_highlight2/install.json" 51 | "jupyterlab_stata_highlight2/labextension/package.json" = "share/jupyter/labextensions/jupyterlab_stata_highlight2/package.json" 52 | 53 | [tool.hatch.build.targets.sdist] 54 | exclude = [ 55 | ".github", 56 | ] 57 | 58 | [tool.hatch.build.hooks.jupyter-builder] 59 | dependencies = [ 60 | "hatch-jupyter-builder>=0.5.0", 61 | ] 62 | build-function = "hatch_jupyter_builder.npm_builder" 63 | ensured-targets = [ 64 | "jupyterlab_stata_highlight2/labextension/static/style.js", 65 | "jupyterlab_stata_highlight2/labextension/package.json", 66 | ] 67 | skip-if-exists = [ 68 | "jupyterlab_stata_highlight2/labextension/static/style.js", 69 | ] 70 | 71 | [tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs] 72 | build_dir = "jupyterlab_stata_highlight2/labextension" 73 | source_dir = "lib" 74 | build_cmd = "build" 75 | 76 | [tool.hatch.build.hooks.jupyter-builder.build-kwargs] 77 | build_cmd = "build:prod" 78 | 79 | [tool.tbump] 80 | field = [ 81 | { name = "channel", default = "" }, 82 | { name = "release", default = "" }, 83 | ] 84 | file = [ 85 | { src = "pyproject.toml" }, 86 | { src = "jupyterlab_stata_highlight2/_version.py" }, 87 | { src = "package.json" }, 88 | ] 89 | 90 | [tool.tbump.version] 91 | current = "0.1.2" 92 | regex = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)((?Pa|b|rc|.dev)(?P\\d+))?" 93 | 94 | [tool.tbump.git] 95 | message_template = "Bump to {new_version}" 96 | tag_template = "v{new_version}" 97 | 98 | [license] 99 | file = "LICENSE" 100 | -------------------------------------------------------------------------------- /lib/stata.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | // Code below adapted from jupyterlab-stata-highlight, copyright (c) by Kyle Barron 5 | // Distributed under an MIT license: https://github.com/kylebarron/jupyterlab-stata-highlight/blob/master/LICENSE 6 | 7 | var builtins_base = [ 8 | 'if', 'else', 'in', 'foreach', 'for', 'forv', 'forva', 9 | 'forval', 'forvalu', 'forvalue', 'forvalues', 'by', 'bys', 10 | 'bysort', 'quietly', 'qui', 'about', 'ac', 11 | 'ac_7', 'acprplot', 'acprplot_7', 'adjust', 'ado', 'adopath', 12 | 'adoupdate', 'alpha', 'ameans', 'an', 'ano', 'anov', 'anova', 13 | 'anova_estat', 'anova_terms', 'anovadef', 'aorder', 'ap', 'app', 14 | 'appe', 'appen', 'append', 'arch', 'arch_dr', 'arch_estat', 15 | 'arch_p', 'archlm', 'areg', 'areg_p', 'args', 'arima', 16 | 'arima_dr', 'arima_estat', 'arima_p', 'as', 'asmprobit', 17 | 'asmprobit_estat', 'asmprobit_lf', 'asmprobit_mfx__dlg', 18 | 'asmprobit_p', 'ass', 'asse', 'asser', 'assert', 'avplot', 19 | 'avplot_7', 'avplots', 'avplots_7', 'bcskew0', 'bgodfrey', 20 | 'binreg', 'bip0_lf', 'biplot', 'bipp_lf', 'bipr_lf', 21 | 'bipr_p', 'biprobit', 'bitest', 'bitesti', 'bitowt', 'blogit', 22 | 'bmemsize', 'boot', 'bootsamp', 'bootstrap', 'bootstrap_8', 23 | 'boxco_l', 'boxco_p', 'boxcox', 'boxcox_6', 'boxcox_p', 24 | 'bprobit', 'br', 'break', 'brier', 'bro', 'brow', 'brows', 25 | 'browse', 'brr', 'brrstat', 'bs', 'bs_7', 'bsampl_w', 26 | 'bsample', 'bsample_7', 'bsqreg', 'bstat', 'bstat_7', 'bstat_8', 27 | 'bstrap', 'bstrap_7', 'ca', 'ca_estat', 'ca_p', 'cabiplot', 28 | 'camat', 'canon', 'canon_8', 'canon_8_p', 'canon_estat', 29 | 'canon_p', 'cap', 'caprojection', 'capt', 'captu', 'captur', 30 | 'capture', 'cat', 'cc', 'cchart', 'cchart_7', 'cci', 31 | 'cd', 'censobs_table', 'centile', 'cf', 'char', 'chdir', 32 | 'checkdlgfiles', 'checkestimationsample', 'checkhlpfiles', 33 | 'checksum', 'chelp', 'ci', 'cii', 'cl', 'class', 'classutil', 34 | 'clear', 'cli', 'clis', 'clist', 'clo', 'clog', 'clog_lf', 35 | 'clog_p', 'clogi', 'clogi_sw', 'clogit', 'clogit_lf', 36 | 'clogit_p', 'clogitp', 'clogl_sw', 'cloglog', 'clonevar', 37 | 'clslistarray', 'cluster', 'cluster_measures', 'cluster_stop', 38 | 'cluster_tree', 'cluster_tree_8', 'clustermat', 'cmdlog', 39 | 'cnr', 'cnre', 'cnreg', 'cnreg_p', 'cnreg_sw', 'cnsreg', 40 | 'codebook', 'collaps4', 'collapse', 'collect', 'colormult_nb', 41 | 'colormult_nw', 'compare', 'compress', 'conf', 'confi', 42 | 'confir', 'confirm', 'conren', 'cons', 'const', 'constr', 43 | 'constra', 'constrai', 'constrain', 'constraint', 'continue', 44 | 'contract', 'copy', 'copyright', 'copysource', 'cor', 'corc', 45 | 'corr', 'corr2data', 'corr_anti', 'corr_kmo', 'corr_smc', 46 | 'corre', 'correl', 'correla', 'correlat', 'correlate', 47 | 'corrgram', 'cou', 'coun', 'count', 'cox', 'cox_p', 'cox_sw', 48 | 'coxbase', 'coxhaz', 'coxvar', 'cprplot', 'cprplot_7', 49 | 'crc', 'cret', 'cretu', 'cretur', 'creturn', 'cross', 'cs', 50 | 'cscript', 'cscript_log', 'csi', 'ct', 'ct_is', 'ctset', 51 | 'ctst_5', 'ctst_st', 'cttost', 'cumsp', 'cumsp_7', 'cumul', 52 | 'cusum', 'cusum_7', 'cutil', 'cwf', 'd', 'datasig', 'datasign', 53 | 'datasigna', 'datasignat', 'datasignatu', 'datasignatur', 54 | 'datasignature', 'datetof', 'db', 'dbeta', 'de', 'dec', 55 | 'deco', 'decod', 'decode', 'deff', 'des', 'desc', 'descr', 56 | 'descri', 'describ', 'describe', 'destring', 'dfbeta', 57 | 'dfgls', 'dfuller', 'di', 'di_g', 'dir', 'dirstats', 'dis', 58 | 'discard', 'disp', 'disp_res', 'disp_s', 'displ', 'displa', 59 | 'display', 'distinct', 'do', 'doe', 'doed', 'doedi', 60 | 'doedit', 'dotplot', 'dotplot_7', 'dprobit', 'drawnorm', 61 | 'drop', 'ds', 'ds_util', 'dstdize', 'duplicates', 'durbina', 62 | 'dwstat', 'dydx', 'e', 'ed', 'edi', 'edit', 'egen', 63 | 'eivreg', 'emdef', 'en', 'enc', 'enco', 'encod', 'encode', 64 | 'eq', 'erase', 'ereg', 'ereg_lf', 'ereg_p', 'ereg_sw', 65 | 'ereghet', 'ereghet_glf', 'ereghet_glf_sh', 'ereghet_gp', 66 | 'ereghet_ilf', 'ereghet_ilf_sh', 'ereghet_ip', 'eret', 67 | 'eretu', 'eretur', 'ereturn', 'err', 'erro', 'error', 'est', 68 | 'est_cfexist', 'est_cfname', 'est_clickable', 'est_expand', 69 | 'est_hold', 'est_table', 'est_unhold', 'est_unholdok', 70 | 'estat', 'estat_default', 'estat_summ', 'estat_vce_only', 71 | 'esti', 'estimates', 'etable', 'etodow', 'etof', 'etomdy', 'ex', 72 | 'exi', 'exit', 'expand', 'expandcl', 'fac', 'fact', 'facto', 73 | 'factor', 'factor_estat', 'factor_p', 'factor_pca_rotated', 74 | 'factor_rotate', 'factormat', 'fcast', 'fcast_compute', 75 | 'fcast_graph', 'fdades', 'fdadesc', 'fdadescr', 'fdadescri', 76 | 'fdadescrib', 'fdadescribe', 'fdasav', 'fdasave', 'fdause', 77 | 'fh_st', 'open', 'read', 'close', 78 | 'file', 'filefilter', 'fillin', 'find_hlp_file', 'findfile', 79 | 'findit', 'findit_7', 'fit', 'fl', 'fli', 'flis', 'flist', 80 | 'for5_0', 'form', 'forma', 'format', 'fpredict', 'frac_154', 81 | 'frac_adj', 'frac_chk', 'frac_cox', 'frac_ddp', 'frac_dis', 82 | 'frac_dv', 'frac_in', 'frac_mun', 'frac_pp', 'frac_pq', 83 | 'frac_pv', 'frac_wgt', 'frac_xo', 'fracgen', 'fracplot', 84 | 'fracplot_7', 'fracpoly', 'fracpred', 'frame', 'frames', 'fron_ex', 'fron_hn', 85 | 'fron_p', 'fron_tn', 'fron_tn2', 'frontier', 'ftodate', 'ftoe', 86 | 'ftomdy', 'ftowdate', 'g', 'gamhet_glf', 'gamhet_gp', 87 | 'gamhet_ilf', 'gamhet_ip', 'gamma', 'gamma_d2', 'gamma_p', 88 | 'gamma_sw', 'gammahet', 'gdi_hexagon', 'gdi_spokes', 'ge', 89 | 'gen', 'gene', 'gener', 'genera', 'generat', 'generate', 90 | 'genrank', 'genstd', 'genvmean', 'gettoken', 'gl', 'gladder', 91 | 'gladder_7', 'glim_l01', 'glim_l02', 'glim_l03', 'glim_l04', 92 | 'glim_l05', 'glim_l06', 'glim_l07', 'glim_l08', 'glim_l09', 93 | 'glim_l10', 'glim_l11', 'glim_l12', 'glim_lf', 'glim_mu', 94 | 'glim_nw1', 'glim_nw2', 'glim_nw3', 'glim_p', 'glim_v1', 95 | 'glim_v2', 'glim_v3', 'glim_v4', 'glim_v5', 'glim_v6', 96 | 'glim_v7', 'glm', 'glm_6', 'glm_p', 'glm_sw', 'glmpred', 'glo', 97 | 'glob', 'globa', 'global', 'glogit', 'glogit_8', 'glogit_p', 98 | 'gmeans', 'gnbre_lf', 'gnbreg', 'gnbreg_5', 'gnbreg_p', 99 | 'gomp_lf', 'gompe_sw', 'gomper_p', 'gompertz', 'gompertzhet', 100 | 'gomphet_glf', 'gomphet_glf_sh', 'gomphet_gp', 'gomphet_ilf', 101 | 'gomphet_ilf_sh', 'gomphet_ip', 'gphdot', 'gphpen', 102 | 'gphprint', 'gprefs', 'gprobi_p', 'gprobit', 'gprobit_8', 'gr', 103 | 'gr7', 'gr_copy', 'gr_current', 'gr_db', 'gr_describe', 104 | 'gr_dir', 'gr_draw', 'gr_draw_replay', 'gr_drop', 'gr_edit', 105 | 'gr_editviewopts', 'gr_example', 'gr_example2', 'gr_export', 106 | 'gr_print', 'gr_qscheme', 'gr_query', 'gr_read', 'gr_rename', 107 | 'gr_replay', 'gr_save', 'gr_set', 'gr_setscheme', 'gr_table', 108 | 'gr_undo', 'gr_use', 'graph', 'graph7', 'grebar', 'greigen', 109 | 'greigen_7', 'greigen_8', 'grmeanby', 'grmeanby_7', 110 | 'gs_fileinfo', 'gs_filetype', 'gs_graphinfo', 'gs_stat', 111 | 'gsort', 'gwood', 'h', 'hadimvo', 'hareg', 'hausman', 112 | 'haver', 'he', 'heck_d2', 'heckma_p', 'heckman', 'heckp_lf', 113 | 'heckpr_p', 'heckprob', 'hel', 'help', 'hereg', 'hetpr_lf', 114 | 'hetpr_p', 'hetprob', 'hettest', 'hexdump', 'hilite', 115 | 'hist', 'hist_7', 'histogram', 'hlogit', 'hlu', 'hmeans', 116 | 'hotel', 'hotelling', 'hprobit', 'hreg', 'hsearch', 'icd9', 117 | 'icd9_ff', 'icd9p', 'iis', 'impute', 'imtest', 'inbase', 118 | 'include', 'inf', 'infi', 'infil', 'infile', 'infix', 'inp', 119 | 'inpu', 'input', 'ins', 'insheet', 'insp', 'inspe', 120 | 'inspec', 'inspect', 'integ', 'inten', 'intreg', 'intreg_7', 121 | 'intreg_p', 'intrg2_ll', 'intrg_ll', 'intrg_ll2', 'ipolate', 122 | 'iqreg', 'ir', 'irf', 'irf_create', 'irfm', 'iri', 'is_svy', 123 | 'is_svysum', 'isid', 'istdize', 'ivprob_1_lf', 'ivprob_lf', 124 | 'ivprobit', 'ivprobit_p', 'ivreg', 'ivreg_footnote', 125 | 'ivtob_1_lf', 'ivtob_lf', 'ivtobit', 'ivtobit_p', 'jackknife', 126 | 'jacknife', 'jknife', 'jknife_6', 'jknife_8', 'jkstat', 127 | 'joinby', 'kalarma1', 'kap', 'kap_3', 'kapmeier', 'kappa', 128 | 'kapwgt', 'kdensity', 'kdensity_7', 'keep', 'ksm', 'ksmirnov', 129 | 'ktau', 'kwallis', 'l', 'la', 'lab', 'labe', 'label', 130 | 'labelbook', 'ladder', 'levels', 'levelsof', 'leverage', 131 | 'lfit', 'lfit_p', 'li', 'lincom', 'line', 'linktest', 132 | 'lis', 'list', 'lloghet_glf', 'lloghet_glf_sh', 'lloghet_gp', 133 | 'lloghet_ilf', 'lloghet_ilf_sh', 'lloghet_ip', 'llogi_sw', 134 | 'llogis_p', 'llogist', 'llogistic', 'llogistichet', 135 | 'lnorm_lf', 'lnorm_sw', 'lnorma_p', 'lnormal', 'lnormalhet', 136 | 'lnormhet_glf', 'lnormhet_glf_sh', 'lnormhet_gp', 137 | 'lnormhet_ilf', 'lnormhet_ilf_sh', 'lnormhet_ip', 'lnskew0', 138 | 'loadingplot', 'loc', 'loca', 'local', 'log', 'logi', 139 | 'logis_lf', 'logistic', 'logistic_p', 'logit', 'logit_estat', 140 | 'logit_p', 'loglogs', 'logrank', 'loneway', 'lookfor', 141 | 'lookup', 'lowess', 'lowess_7', 'lpredict', 'lrecomp', 'lroc', 142 | 'lroc_7', 'lrtest', 'ls', 'lsens', 'lsens_7', 'lsens_x', 143 | 'lstat', 'ltable', 'ltable_7', 'ltriang', 'lv', 'lvr2plot', 144 | 'lvr2plot_7', 'm', 'ma', 'mac', 'macr', 'macro', 'makecns', 145 | 'man', 'manova', 'manova_estat', 'manova_p', 'manovatest', 146 | 'mantel', 'mark', 'markin', 'markout', 'marksample', 'mat', 147 | 'mat_capp', 'mat_order', 'mat_put_rr', 'mat_rapp', 'mata', 148 | 'mata_clear', 'mata_describe', 'mata_drop', 'mata_matdescribe', 149 | 'mata_matsave', 'mata_matuse', 'mata_memory', 'mata_mlib', 150 | 'mata_mosave', 'mata_rename', 'mata_which', 'matalabel', 151 | 'matcproc', 'matlist', 'matname', 'matr', 'matri', 152 | 'matrix', 'matrix_input__dlg', 'matstrik', 'mcc', 'mcci', 153 | 'md0_', 'md1_', 'md1debug_', 'md2_', 'md2debug_', 'mds', 154 | 'mds_estat', 'mds_p', 'mdsconfig', 'mdslong', 'mdsmat', 155 | 'mdsshepard', 'mdytoe', 'mdytof', 'me_derd', 'mean', 156 | 'means', 'median', 'memory', 'memsize', 'meqparse', 'mer', 157 | 'merg', 'merge', 'mfp', 'mfx', 'mhelp', 'mhodds', 'minbound', 158 | 'mixed_ll', 'mixed_ll_reparm', 'mkassert', 'mkdir', 159 | 'mkmat', 'mkspline', 'ml', 'ml_5', 'ml_adjs', 'ml_bhhhs', 160 | 'ml_c_d', 'ml_check', 'ml_clear', 'ml_cnt', 'ml_debug', 161 | 'ml_defd', 'ml_e0', 'ml_e0_bfgs', 'ml_e0_cycle', 'ml_e0_dfp', 162 | 'ml_e0i', 'ml_e1', 'ml_e1_bfgs', 'ml_e1_bhhh', 'ml_e1_cycle', 163 | 'ml_e1_dfp', 'ml_e2', 'ml_e2_cycle', 'ml_ebfg0', 'ml_ebfr0', 164 | 'ml_ebfr1', 'ml_ebh0q', 'ml_ebhh0', 'ml_ebhr0', 'ml_ebr0i', 165 | 'ml_ecr0i', 'ml_edfp0', 'ml_edfr0', 'ml_edfr1', 'ml_edr0i', 166 | 'ml_eds', 'ml_eer0i', 'ml_egr0i', 'ml_elf', 'ml_elf_bfgs', 167 | 'ml_elf_bhhh', 'ml_elf_cycle', 'ml_elf_dfp', 'ml_elfi', 168 | 'ml_elfs', 'ml_enr0i', 'ml_enrr0', 'ml_erdu0', 'ml_erdu0_bfgs', 169 | 'ml_erdu0_bhhh', 'ml_erdu0_bhhhq', 'ml_erdu0_cycle', 170 | 'ml_erdu0_dfp', 'ml_erdu0_nrbfgs', 'ml_exde', 'ml_footnote', 171 | 'ml_geqnr', 'ml_grad0', 'ml_graph', 'ml_hbhhh', 'ml_hd0', 172 | 'ml_hold', 'ml_init', 'ml_inv', 'ml_log', 'ml_max', 173 | 'ml_mlout', 'ml_mlout_8', 'ml_model', 'ml_nb0', 'ml_opt', 174 | 'ml_p', 'ml_plot', 'ml_query', 'ml_rdgrd', 'ml_repor', 175 | 'ml_s_e', 'ml_score', 'ml_searc', 'ml_technique', 'ml_unhold', 176 | 'mleval', 'mlf_', 'mlmatbysum', 'mlmatsum', 'mlog', 'mlogi', 177 | 'mlogit', 'mlogit_footnote', 'mlogit_p', 'mlopts', 'mlsum', 178 | 'mlvecsum', 'mnl0_', 'mor', 'more', 'mov', 'move', 'mprobit', 179 | 'mprobit_lf', 'mprobit_p', 'mrdu0_', 'mrdu1_', 'mvdecode', 180 | 'mvencode', 'mvreg', 'mvreg_estat', 'n', 'nbreg', 181 | 'nbreg_al', 'nbreg_lf', 'nbreg_p', 'nbreg_sw', 'nestreg', 'net', 182 | 'newey', 'newey_7', 'newey_p', 'news', 'nl', 'nl_7', 'nl_9', 183 | 'nl_9_p', 'nl_p', 'nl_p_7', 'nlcom', 'nlcom_p', 'nlexp2', 184 | 'nlexp2_7', 'nlexp2a', 'nlexp2a_7', 'nlexp3', 'nlexp3_7', 185 | 'nlgom3', 'nlgom3_7', 'nlgom4', 'nlgom4_7', 'nlinit', 'nllog3', 186 | 'nllog3_7', 'nllog4', 'nllog4_7', 'nlog_rd', 'nlogit', 187 | 'nlogit_p', 'nlogitgen', 'nlogittree', 'nlpred', 'no', 188 | 'nobreak', 'noi', 'nois', 'noisi', 'noisil', 'noisily', 'note', 189 | 'notes', 'notes_dlg', 'nptrend', 'numlabel', 'numlist', 'odbc', 190 | 'old_ver', 'olo', 'olog', 'ologi', 'ologi_sw', 'ologit', 191 | 'ologit_p', 'ologitp', 'on', 'one', 'onew', 'onewa', 'oneway', 192 | 'op_colnm', 'op_comp', 'op_diff', 'op_inv', 'op_str', 'opr', 193 | 'opro', 'oprob', 'oprob_sw', 'oprobi', 'oprobi_p', 'oprobit', 194 | 'oprobitp', 'opts_exclusive', 'order', 'orthog', 'orthpoly', 195 | 'ou', 'out', 'outf', 'outfi', 'outfil', 'outfile', 'outs', 196 | 'outsh', 'outshe', 'outshee', 'outsheet', 'ovtest', 'pac', 197 | 'pac_7', 'palette', 'parse', 'parse_dissim', 'pause', 'pca', 198 | 'pca_8', 'pca_display', 'pca_estat', 'pca_p', 'pca_rotate', 199 | 'pcamat', 'pchart', 'pchart_7', 'pchi', 'pchi_7', 'pcorr', 200 | 'pctile', 'pentium', 'pergram', 'pergram_7', 'permute', 201 | 'permute_8', 'personal', 'peto_st', 'pkcollapse', 'pkcross', 202 | 'pkequiv', 'pkexamine', 'pkexamine_7', 'pkshape', 'pksumm', 203 | 'pksumm_7', 'pl', 'plo', 'plot', 'plugin', 'pnorm', 204 | 'pnorm_7', 'poisgof', 'poiss_lf', 'poiss_sw', 'poisso_p', 205 | 'poisson', 'poisson_estat', 'post', 'postclose', 'postfile', 206 | 'postutil', 'pperron', 'pr', 'prais', 'prais_e', 'prais_e2', 207 | 'prais_p', 'predict', 'predictnl', 'preserve', 'print', 208 | 'pro', 'prob', 'probi', 'probit', 'probit_estat', 'probit_p', 209 | 'proc_time', 'procoverlay', 'procrustes', 'procrustes_estat', 210 | 'procrustes_p', 'profiler', 'prog', 'progr', 'progra', 211 | 'program', 'prop', 'proportion', 'prtest', 'prtesti', 'pwcorr', 212 | 'pwd', 'pwf', 'q', 's', 'qby', 'qbys', 'qchi', 'qchi_7', 'qladder', 213 | 'qladder_7', 'qnorm', 'qnorm_7', 'qqplot', 'qqplot_7', 'qreg', 214 | 'qreg_c', 'qreg_p', 'qreg_sw', 'qu', 'quadchk', 'quantile', 215 | 'quantile_7', 'que', 'quer', 'query', 'range', 'ranksum', 216 | 'ratio', 'rchart', 'rchart_7', 'rcof', 'recast', 'reclink', 217 | 'recode', 'reg', 'reg3', 'reg3_p', 'regdw', 'regr', 'regre', 218 | 'regre_p2', 'regres', 'regres_p', 'regress', 'regress_estat', 219 | 'regriv_p', 'remap', 'ren', 'rena', 'renam', 'rename', 220 | 'renpfix', 'repeat', 'replace', 'report', 'reshape', 221 | 'restore', 'ret', 'retu', 'retur', 'return', 'rm', 'rmdir', 222 | 'robvar', 'roccomp', 'roccomp_7', 'roccomp_8', 'rocf_lf', 223 | 'rocfit', 'rocfit_8', 'rocgold', 'rocplot', 'rocplot_7', 224 | 'roctab', 'roctab_7', 'rolling', 'rologit', 'rologit_p', 225 | 'rot', 'rota', 'rotat', 'rotate', 'rotatemat', 'rreg', 226 | 'rreg_p', 'ru', 'run', 'runtest', 'rvfplot', 'rvfplot_7', 227 | 'rvpplot', 'rvpplot_7', 'sa', 'safesum', 'sample', 228 | 'sampsi', 'sav', 'save', 'savedresults', 'saveold', 'sc', 229 | 'sca', 'scal', 'scala', 'scalar', 'scatter', 'scm_mine', 230 | 'sco', 'scob_lf', 'scob_p', 'scobi_sw', 'scobit', 'scor', 231 | 'score', 'scoreplot', 'scoreplot_help', 'scree', 'screeplot', 232 | 'screeplot_help', 'sdtest', 'sdtesti', 'se', 'search', 233 | 'separate', 'seperate', 'serrbar', 'serrbar_7', 'serset', 'set', 234 | 'set_defaults', 'sfrancia', 'sh', 'she', 'shel', 'shell', 235 | 'shewhart', 'shewhart_7', 'signestimationsample', 'signrank', 236 | 'signtest', 'simul', 'simul_7', 'simulate', 'simulate_8', 237 | 'sktest', 'sleep', 'slogit', 'slogit_d2', 'slogit_p', 'smooth', 238 | 'snapspan', 'so', 'sor', 'sort', 'spearman', 'spikeplot', 239 | 'spikeplot_7', 'spikeplt', 'spline_x', 'split', 'sqreg', 240 | 'sqreg_p', 'sret', 'sretu', 'sretur', 'sreturn', 'ssc', 'st', 241 | 'st_ct', 'st_hc', 'st_hcd', 'st_hcd_sh', 'st_is', 'st_issys', 242 | 'st_note', 'st_promo', 'st_set', 'st_show', 'st_smpl', 243 | 'st_subid', 'stack', 'statsby', 'statsby_8', 'stbase', 'stci', 244 | 'stci_7', 'stcox', 'stcox_estat', 'stcox_fr', 'stcox_fr_ll', 245 | 'stcox_p', 'stcox_sw', 'stcoxkm', 'stcoxkm_7', 'stcstat', 246 | 'stcurv', 'stcurve', 'stcurve_7', 'stdes', 'stem', 'stepwise', 247 | 'stereg', 'stfill', 'stgen', 'stir', 'stjoin', 'stmc', 'stmh', 248 | 'stphplot', 'stphplot_7', 'stphtest', 'stphtest_7', 249 | 'stptime', 'strate', 'strate_7', 'streg', 'streg_sw', 'streset', 250 | 'sts', 'sts_7', 'stset', 'stsplit', 'stsum', 'sttocc', 251 | 'sttoct', 'stvary', 'stweib', 'su', 'suest', 'suest_8', 252 | 'sum', 'summ', 'summa', 'summar', 'summari', 'summariz', 253 | 'summarize', 'sunflower', 'sureg', 'survcurv', 'survsum', 254 | 'svar', 'svar_p', 'svmat', 'svy', 'svy_disp', 'svy_dreg', 255 | 'svy_est', 'svy_est_7', 'svy_estat', 'svy_get', 'svy_gnbreg_p', 256 | 'svy_head', 'svy_header', 'svy_heckman_p', 'svy_heckprob_p', 257 | 'svy_intreg_p', 'svy_ivreg_p', 'svy_logistic_p', 'svy_logit_p', 258 | 'svy_mlogit_p', 'svy_nbreg_p', 'svy_ologit_p', 'svy_oprobit_p', 259 | 'svy_poisson_p', 'svy_probit_p', 'svy_regress_p', 'svy_sub', 260 | 'svy_sub_7', 'svy_x', 'svy_x_7', 'svy_x_p', 'svydes', 261 | 'svydes_8', 'svygen', 'svygnbreg', 'svyheckman', 'svyheckprob', 262 | 'svyintreg', 'svyintreg_7', 'svyintrg', 'svyivreg', 'svylc', 263 | 'svylog_p', 'svylogit', 'svymarkout', 'svymarkout_8', 264 | 'svymean', 'svymlog', 'svymlogit', 'svynbreg', 'svyolog', 265 | 'svyologit', 'svyoprob', 'svyoprobit', 'svyopts', 266 | 'svypois', 'svypois_7', 'svypoisson', 'svyprobit', 'svyprobt', 267 | 'svyprop', 'svyprop_7', 'svyratio', 'svyreg', 'svyreg_p', 268 | 'svyregress', 'svyset', 'svyset_7', 'svyset_8', 'svytab', 269 | 'svytab_7', 'svytest', 'svytotal', 'sw', 'sw_8', 'swcnreg', 270 | 'swcox', 'swereg', 'swilk', 'swlogis', 'swlogit', 271 | 'swologit', 'swoprbt', 'swpois', 'swprobit', 'swqreg', 272 | 'swtobit', 'swweib', 'symmetry', 'symmi', 'symplot', 273 | 'symplot_7', 'syntax', 'sysdescribe', 'sysdir', 'sysuse', 274 | 'szroeter', 'ta', 'tab', 'tab1', 'tab2', 'tab_or', 'tabd', 275 | 'tabdi', 'tabdis', 'tabdisp', 'tabi', 'table', 'tabodds', 276 | 'tabodds_7', 'tabstat', 'tabu', 'tabul', 'tabula', 'tabulat', 277 | 'tabulate', 'te', 'tempfile', 'tempname', 'tempvar', 'tes', 278 | 'test', 'testnl', 'testparm', 'teststd', 'tetrachoric', 279 | 'time_it', 'timer', 'tis', 'tob', 'tobi', 'tobit', 'tobit_p', 280 | 'tobit_sw', 'token', 'tokeni', 'tokeniz', 'tokenize', 281 | 'tostring', 'total', 'translate', 'translator', 'transmap', 282 | 'treat_ll', 'treatr_p', 'treatreg', 'trim', 'trnb_cons', 283 | 'trnb_mean', 'trpoiss_d2', 'trunc_ll', 'truncr_p', 'truncreg', 284 | 'tsappend', 'tset', 'tsfill', 'tsline', 'tsline_ex', 285 | 'tsreport', 'tsrevar', 'tsrline', 'tsset', 'tssmooth', 286 | 'tsunab', 'ttest', 'ttesti', 'tut_chk', 'tut_wait', 'tutorial', 287 | 'tw', 'tware_st', 'two', 'twoway', 'twoway__fpfit_serset', 288 | 'twoway__function_gen', 'twoway__histogram_gen', 289 | 'twoway__ipoint_serset', 'twoway__ipoints_serset', 290 | 'twoway__kdensity_gen', 'twoway__lfit_serset', 291 | 'twoway__normgen_gen', 'twoway__pci_serset', 292 | 'twoway__qfit_serset', 'twoway__scatteri_serset', 293 | 'twoway__sunflower_gen', 'twoway_ksm_serset', 'ty', 'typ', 294 | 'type', 'typeof', 'u', 'unab', 'unabbrev', 'unabcmd', 295 | 'update', 'us', 'use', 'uselabel', 'var', 'var_mkcompanion', 296 | 'var_p', 'varbasic', 'varfcast', 'vargranger', 'varirf', 297 | 'varirf_add', 'varirf_cgraph', 'varirf_create', 'varirf_ctable', 298 | 'varirf_describe', 'varirf_dir', 'varirf_drop', 'varirf_erase', 299 | 'varirf_graph', 'varirf_ograph', 'varirf_rename', 'varirf_set', 300 | 'varirf_table', 'varlist', 'varlmar', 'varnorm', 'varsoc', 301 | 'varstable', 'varstable_w', 'varstable_w2', 'varwle', 302 | 'vce', 'vec', 'vec_fevd', 'vec_mkphi', 'vec_p', 'vec_p_w', 303 | 'vecirf_create', 'veclmar', 'veclmar_w', 'vecnorm', 304 | 'vecnorm_w', 'vecrank', 'vecstable', 'verinst', 'vers', 305 | 'versi', 'versio', 'version', 'view', 'viewsource', 'vif', 'vl', 306 | 'vwls', 'wdatetof', 'webdescribe', 'webseek', 'webuse', 307 | 'weib1_lf', 'weib2_lf', 'weib_lf', 'weib_lf0', 'weibhet_glf', 308 | 'weibhet_glf_sh', 'weibhet_glfa', 'weibhet_glfa_sh', 309 | 'weibhet_gp', 'weibhet_ilf', 'weibhet_ilf_sh', 'weibhet_ilfa', 310 | 'weibhet_ilfa_sh', 'weibhet_ip', 'weibu_sw', 'weibul_p', 311 | 'weibull', 'weibull_c', 'weibull_s', 'weibullhet', 312 | 'wh', 'whelp', 'whi', 'which', 'whil', 'while', 'wilc_st', 313 | 'wilcoxon', 'win', 'wind', 'windo', 'window', 'winexec', 314 | 'wntestb', 'wntestb_7', 'wntestq', 'xchart', 'xchart_7', 315 | 'xcorr', 'xcorr_7', 'xi', 'xi_6', 'xmlsav', 'xmlsave', 316 | 'xmluse', 'xpose', 'xsh', 'xshe', 'xshel', 'xshell', 317 | 'xt_iis', 'xt_tis', 'xtab_p', 'xtabond', 'xtbin_p', 318 | 'xtclog', 'xtcloglog', 'xtcloglog_8', 'xtcloglog_d2', 319 | 'xtcloglog_pa_p', 'xtcloglog_re_p', 'xtcnt_p', 'xtcorr', 320 | 'xtdata', 'xtdes', 'xtfront_p', 'xtfrontier', 'xtgee', 321 | 'xtgee_elink', 'xtgee_estat', 'xtgee_makeivar', 'xtgee_p', 322 | 'xtgee_plink', 'xtgls', 'xtgls_p', 'xthaus', 'xthausman', 323 | 'xtht_p', 'xthtaylor', 'xtile', 'xtint_p', 'xtintreg', 324 | 'xtintreg_8', 'xtintreg_d2', 'xtintreg_p', 'xtivp_1', 325 | 'xtivp_2', 'xtivreg', 'xtline', 'xtline_ex', 'xtlogit', 326 | 'xtlogit_8', 'xtlogit_d2', 'xtlogit_fe_p', 'xtlogit_pa_p', 327 | 'xtlogit_re_p', 'xtmixed', 'xtmixed_estat', 'xtmixed_p', 328 | 'xtnb_fe', 'xtnb_lf', 'xtnbreg', 'xtnbreg_pa_p', 329 | 'xtnbreg_refe_p', 'xtpcse', 'xtpcse_p', 'xtpois', 'xtpoisson', 330 | 'xtpoisson_d2', 'xtpoisson_pa_p', 'xtpoisson_refe_p', 'xtpred', 331 | 'xtprobit', 'xtprobit_8', 'xtprobit_d2', 'xtprobit_re_p', 332 | 'xtps_fe', 'xtps_lf', 'xtps_ren', 'xtps_ren_8', 'xtrar_p', 333 | 'xtrc', 'xtrc_p', 'xtrchh', 'xtrefe_p', 'xtreg', 'xtreg_be', 334 | 'xtreg_fe', 'xtreg_ml', 'xtreg_pa_p', 'xtreg_re', 335 | 'xtregar', 'xtrere_p', 'xtset', 'xtsf_ll', 'xtsf_llti', 336 | 'xtsum', 'xttab', 'xttest0', 'xttobit', 'xttobit_8', 337 | 'xttobit_p', 'xttrans', 'yx', 'yxview__barlike_draw', 338 | 'yxview_area_draw', 'yxview_bar_draw', 'yxview_dot_draw', 339 | 'yxview_dropline_draw', 'yxview_function_draw', 340 | 'yxview_iarrow_draw', 'yxview_ilabels_draw', 341 | 'yxview_normal_draw', 'yxview_pcarrow_draw', 342 | 'yxview_pcbarrow_draw', 'yxview_pccapsym_draw', 343 | 'yxview_pcscatter_draw', 'yxview_pcspike_draw', 344 | 'yxview_rarea_draw', 'yxview_rbar_draw', 'yxview_rbarm_draw', 345 | 'yxview_rcap_draw', 'yxview_rcapsym_draw', 346 | 'yxview_rconnected_draw', 'yxview_rline_draw', 347 | 'yxview_rscatter_draw', 'yxview_rspike_draw', 348 | 'yxview_spike_draw', 'yxview_sunflower_draw', 'zap_s', 'zinb', 349 | 'zinb_llf', 'zinb_plf', 'zip', 'zip_llf', 'zip_p', 'zip_plf', 350 | 'zt_ct_5', 'zt_hc_5', 'zt_hcd_5', 'zt_is_5', 'zt_iss_5', 351 | 'zt_sho_5', 'zt_smp_5', 'ztbase_5', 'ztcox_5', 'ztdes_5', 352 | 'ztereg_5', 'ztfill_5', 'ztgen_5', 'ztir_5', 'ztjoin_5', 'ztnb', 353 | 'ztnb_p', 'ztp', 'ztp_p', 'zts_5', 'ztset_5', 'ztspli_5', 354 | 'ztsum_5', 'zttoct_5', 'ztvary_5', 'ztweib_5']; 355 | var builtins_str = '(' + builtins_base.join('|') + ')'; 356 | 357 | var builtins_functions = [ 358 | 'Cdhms', 'Chms', 'Clock', 'Cmdyhms', 'Cofc', 'Cofd', 'F', 359 | 'Fden', 'Ftail', 'I', 'J', '_caller', 'abbrev', 'abs', 'acos', 360 | 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 361 | 'autocode', 'betaden', 'binomial', 'binomialp', 'binomialtail', 362 | 'binormal', 'bofd', 'byteorder', 'c', 'ceil', 'char', 363 | 'chi2', 'chi2den', 'chi2tail', 'cholesky', 'chop', 'clip', 364 | 'clock', 'cloglog', 'cofC', 'cofd', 'colnumb', 'colsof', 'comb', 365 | 'cond', 'corr', 'cos', 'cosh', 'd', 'daily', 'date', 'day', 366 | 'det', 'dgammapda', 'dgammapdada', 'dgammapdadx', 'dgammapdx', 367 | 'dgammapdxdx', 'dhms', 'diag', 'diag0cnt', 'digamma', 368 | 'dofC', 'dofb', 'dofc', 'dofh', 'dofm', 'dofq', 'dofw', 369 | 'dofy', 'dow', 'doy', 'dunnettprob', 'e', 'el', 'epsdouble', 370 | 'epsfloat', 'exp', 'fileexists', 'fileread', 'filereaderror', 371 | 'filewrite', 'float', 'floor', 'fmtwidth', 'gammaden', 372 | 'gammap', 'gammaptail', 'get', 'group', 'h', 'hadamard', 373 | 'halfyear', 'halfyearly', 'has_eprop', 'hh', 'hhC', 'hms', 374 | 'hofd', 'hours', 'hypergeometric', 'hypergeometricp', 'ibeta', 375 | 'ibetatail', 'index', 'indexnot', 'inlist', 'inrange', 'int', 376 | 'inv', 'invF', 'invFtail', 'invbinomial', 'invbinomialtail', 377 | 'invchi2', 'invchi2tail', 'invcloglog', 'invdunnettprob', 378 | 'invgammap', 'invgammaptail', 'invibeta', 'invibetatail', 379 | 'invlogit', 'invnFtail', 'invnbinomial', 'invnbinomialtail', 380 | 'invnchi2', 'invnchi2tail', 'invnibeta', 'invnorm', 'invnormal', 381 | 'invnttail', 'invpoisson', 'invpoissontail', 'invsym', 'invt', 382 | 'invttail', 'invtukeyprob', 'irecode', 'issym', 'issymmetric', 383 | 'itrim', 'length', 'ln', 'lnfact', 'lnfactorial', 'lngamma', 384 | 'lnnormal', 'lnnormalden', 'log', 'log10', 'logit', 'lower', 385 | 'ltrim', 'm', 'match', 'matmissing', 'matrix', 'matuniform', 386 | 'max', 'maxbyte', 'maxdouble', 'maxfloat', 'maxint', 'maxlong', 387 | 'mdy', 'mdyhms', 'mi', 'min', 'minbyte', 'mindouble', 388 | 'minfloat', 'minint', 'minlong', 'minutes', 'missing', 'mm', 389 | 'mmC', 'mod', 'mofd', 'month', 'monthly', 'mreldif', 390 | 'msofhours', 'msofminutes', 'msofseconds', 'nF', 'nFden', 391 | 'nFtail', 'nbetaden', 'nbinomial', 'nbinomialp', 'nbinomialtail', 392 | 'nchi2', 'nchi2den', 'nchi2tail', 'nibeta', 'norm', 'normal', 393 | 'normalden', 'normd', 'npnF', 'npnchi2', 'npnt', 'nt', 'ntden', 394 | 'nttail', 'nullmat', 'plural', 'poisson', 'poissonp', 395 | 'poissontail', 'proper', 'q', 'qofd', 'quarter', 'quarterly', 396 | 'r', 'rbeta', 'rbinomial', 'rchi2', 'real', 'recode', 'regexm', 397 | 'regexr', 'regexs', 'reldif', 'replay', 'return', 'reverse', 398 | 'rgamma', 'rhypergeometric', 'rnbinomial', 'rnormal', 'round', 399 | 'rownumb', 'rowsof', 'rpoisson', 'rt', 'rtrim', 'runiform', 's', 400 | 'scalar', 'seconds', 'sign', 'sin', 'sinh', 'smallestdouble', 401 | 'soundex', 'soundex_nara', 'sqrt', 'ss', 'ssC', 'strcat', 402 | 'strdup', 'string', 'strlen', 'strlower', 'strltrim', 'strmatch', 403 | 'strofreal', 'strpos', 'strproper', 'strreverse', 'strrtrim', 404 | 'strtoname', 'strtrim', 'strupper', 'subinstr', 'subinword', 405 | 'substr', 'sum', 'sweep', 'syminv', 't', 'tC', 'tan', 'tanh', 406 | 'tc', 'td', 'tden', 'th', 'tin', 'tm', 'tq', 'trace', 407 | 'trigamma', 'trim', 'trunc', 'ttail', 'tukeyprob', 'tw', 408 | 'twithin', 'uniform', 'upper', 'vec', 'vecdiag', 'w', 'week', 409 | 'weekly', 'wofd', 'word', 'wordcount', 'year', 'yearly', 410 | 'yh', 'ym', 'yofd', 'yq', 'yw']; 411 | var builtins_fun_str = '(' + builtins_functions.join('|') + ')(?=\\()'; 412 | 413 | var color_translator = { 414 | 'comment': 'builtin', 415 | 'string': 'string', 416 | 'variable-2': 'variable-2', 417 | 'keyword': 'string-2', 418 | 'def': 'def', 419 | }; 420 | 421 | 422 | export const stata_mode = { 423 | // The start state contains the rules that are initially used 424 | start: [ 425 | // Comments 426 | {regex: /\/\/\/?.*$/, token: color_translator['comment'], sol: true}, 427 | {regex: /(\s)\/\/\/?.*$/, token: color_translator['comment']}, 428 | {regex: /\s*\*.*$/, token: color_translator['comment'], sol: true}, 429 | {regex: /\/\*/, token: color_translator['comment'], push: 'comments_block'}, 430 | 431 | // Strings 432 | {regex: /"/, token: color_translator['string'], push: 'string_regular'}, 433 | {regex: /`"/, token: color_translator['string'], push: 'string_compound'}, 434 | 435 | // Macros 436 | {regex: /`/, token: color_translator['variable-2'], push: 'macro_local'}, 437 | {regex: /\$/, token: color_translator['variable-2'], push: 'macro_global'}, 438 | 439 | // Keywords 440 | // There are two separate dictionaries because the `\b` at the beginning of the regex seemed not to work. So instead, I either match the preceding space before the keyword or require the keyword to be at beginning of the string. I think this necessitates two different strings. 441 | {regex: new RegExp('\\s' + builtins_str + '(?![\\(\\w])'), token: color_translator['keyword']}, 442 | {regex: new RegExp(builtins_str + '\\b'), token: color_translator['keyword'], sol: true}, 443 | 444 | {regex: new RegExp('(\\W)' + builtins_fun_str), token: [null, color_translator['def']]}, 445 | // {regex: /\s\w+(?=\()/, token: color_translator['def']}, 446 | 447 | {regex: /[\{]/, indent: true}, 448 | {regex: /[\}]/, dedent: true}, 449 | 450 | // {regex: /-|==|<=|>=|<|>|&|!=/, token: 'operator'}, 451 | // {regex: /\*|\+|\^|\/|!|~|=|~=/, token: 'operator'}, 452 | ], 453 | comments_block: [ 454 | {regex: /\/\*/, token: color_translator['comment'], push: 'comments_block'}, 455 | // this ends and restarts a comment block. but need to catch this so 456 | // that it doesn\'t start _another_ level of comment blocks 457 | {regex: /\*\/\*/, token: color_translator['comment']}, 458 | {regex: /(\*\/\s+\*(?!\/)[^\n]*)|(\*\/)/, token: color_translator['comment'], pop: true}, 459 | // Match anything else as a character inside the comment 460 | {regex: /./, token: color_translator['comment']}, 461 | ], 462 | 463 | string_compound: [ 464 | {regex: /`"/, token: color_translator['string'], push: 'string_compound'}, 465 | {regex: /"'/, token: color_translator['string'], pop: true}, 466 | {regex: /`/, token: color_translator['variable-2'], push: 'macro_local'}, 467 | {regex: /\$/, token: color_translator['variable-2'], push: 'macro_global'}, 468 | {regex: /./, token: color_translator['string']} 469 | ], 470 | string_regular: [ 471 | {regex: /"/, token: color_translator['string'], pop: true}, 472 | {regex: /`/, token: color_translator['variable-2'], push: 'macro_local'}, 473 | {regex: /\$/, token: color_translator['variable-2'], push: 'macro_global'}, 474 | {regex: /./, token: color_translator['string']} 475 | ], 476 | macro_local: [ 477 | {regex: /`/, token: color_translator['variable-2'], push: 'macro_local'}, 478 | {regex: /'/, token: color_translator['variable-2'], pop: true}, 479 | {regex: /./, token: color_translator['variable-2']}, 480 | ], 481 | macro_global: [ 482 | {regex: /\}/, token: color_translator['variable-2'], pop: true}, 483 | {regex: /.(?=[^\w\{\}])/, token: color_translator['variable-2'], pop: true}, 484 | {regex: /./, token: color_translator['variable-2']}, 485 | ], 486 | meta: { 487 | closeBrackets: {pairs: "()[]{}`'\"\""}, 488 | dontIndentStates: [color_translator['comment']], 489 | electricInput: /^\s*\}$/, 490 | blockCommentStart: '/*', 491 | blockCommentEnd: '*/', 492 | lineComment: '//', 493 | fold: 'brace' 494 | } 495 | }; 496 | --------------------------------------------------------------------------------