summaryrefslogtreecommitdiff
path: root/pygments/lexers/javascript.py
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year to 2023.Matthäus G. Chajdas2023-03-291-1/+1
|
* all: move often-used "line_re" to pygments.lexerGeorg Brandl2022-10-271-2/+1
|
* Objective-J: fix catastrophic backtracking in comment regex (#2225)Jean Abou-Samra2022-09-151-1/+1
| | | | | | This use of *? was both incorrect and catastrophically backtracking when embedding this regex into a larger regex with a trailing pattern, since it could match much more than intended and try exponentially many positions in that process.
* Rework URL information in lexers.Matthäus G. Chajdas2022-03-201-20/+17
| | | | | | | | This commit adds a new url field to a lexer, which can be used to link to the language website, instead of relying on having the link in either languages.rst or the docstring of the lexer. Additionally, it changes the languages.rst file to auto-generate the list of lexers from the actual source code, using the provided URL.
* Merge branch 'master' of github.com:pygments/pygments; branch 'lexers_ijkl' ↵Matthäus G. Chajdas2022-02-201-118/+156
|\ | | | | | | of https://github.com/blu-base/pygments into blu-base-lexers_ijkl
| * Ws token remaining javascript lexersSebastian Engel2022-01-061-13/+14
| |
| * Ws token coffee lexerSebastian Engel2022-01-061-16/+22
| |
| * Ws token objective-j lexerSebastian Engel2022-01-061-20/+20
| |
| * Ws token dart,lasso lexerSebastian Engel2022-01-061-31/+38
| |
| * Ws token livescript lexerSebastian Engel2022-01-061-6/+9
| |
| * Ws token kal lexerSebastian Engel2022-01-061-24/+45
| |
| * Ws token - typescriptSebastian Engel2022-01-061-4/+4
| |
| * Modernize Whitespace token in lexer javascriptSebastian Engel2022-01-061-6/+6
| |
* | Remove now redundant re.UNICODE and (?u) (#2058)Jean Abou-Samra2022-01-311-7/+7
| |
* | Happy new year.Georg Brandl2022-01-251-1/+1
|/
* Merge branch 'master' of https://github.com/cltrudeau/pygments into ↵Matthäus G. Chajdas2021-08-081-6/+69
|\ | | | | | | cltrudeau-master
| * Changes from code review:Christopher Trudeau2021-06-211-6/+7
| | | | | | | | | | - renamed nodecon to nodejsrepl - removed bad mimetypes
| * Add JavaScript Node.js Console LexerChristopher Trudeau2021-05-291-4/+66
| |
* | Update javascript lexer (#1814)Mestery2021-07-181-122/+77
|/ | | | | | | | | | | | | | | * make ts extends js lexer * add regex's d flag for js lexers cf. https://v8.dev/features/regexp-match-indices * update js builtins, operators, exceptions * fixup! update js builtins, operators, exceptions * add typescript override keywork * Update _mapping.py
* add "from" and "as" to js and ts keywords (#1741)Mestery2021-05-021-3/+3
| | | Also removed invalid "AS" from TypeScript lexer.
* uniformize aliases order (#1780)Mestery2021-04-261-6/+6
| | | | | * uniformize aliases order * LighttpdConfLexer: add lighttpd.conf filename
* Fix various issues found by make check.Matthäus G. Chajdas2021-02-141-2/+4
|
* Run pyupgrade across codebase to modernize syntax and patterns (#1622)Jon Dufresne2021-01-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | pyupgrade is a tool to automatically upgrade syntax for newer versions of the Python language. The project has been Python 3 only since 35544e2fc6eed0ce4a27ec7285aac71ff0ddc473, allowing for several cleanups: - Remove unnecessary "-*- coding: utf-8 -*-" cookie. Python 3 reads all source files as utf-8 by default. - Replace IOError/EnvironmentError with OSError. Python 3 unified these exceptions. The old names are aliases only. - Use the Python 3 shorter super() syntax. - Remove "utf8" argument form encode/decode. In Python 3, this value is the default. - Remove "r" from open() calls. In Python 3, this value is the default. - Remove u prefix from Unicode strings. In Python 3, all strings are Unicode. - Replace io.open() with builtin open(). In Python 3, these functions are functionally equivalent. Co-authored-by: Matthäus G. Chajdas <Anteru@users.noreply.github.com>
* fix escape in TypeScript templates literalsMestery2021-01-171-2/+1
|
* Fix escapes in JavaScript backtick stringsGeorg Brandl2021-01-171-2/+1
| | | | fixes #1679
* Merge branch 'master' of https://github.com/felixhao28/pygments into ↵Matthäus G. Chajdas2021-01-041-1/+1
|\ | | | | | | felixhao28-master
| * fix punctuation not labeled in function definition in TypeScriptYiyang Hao2020-08-161-1/+1
| |
* | Bump copyright year.Matthäus G. Chajdas2021-01-031-1/+1
| |
* | Update keywords for JS and its variants (#1651)Mestery2021-01-021-37/+35
| | | | | | | | | | | | | | Some of the keywords are missing for JavaScript and TypeScript. And some of reserved keywords have been moved to `keywords` and `declarations keywords`. There are also non-existent builtins that I removed. Added missing builtins.
* | add support for LiveScript and CoffeeScriptMestery2020-12-281-4/+4
| |
* | Fix regexs to support somes flagsMestery2020-12-281-4/+4
| | | | | | Resolves #1646
* | fix a lot more backtracking string regexesGeorg Brandl2020-12-251-28/+8
| |
* | Fix backtracking string regexes in JavascriptLexer und TypescriptLexer.Georg Brandl2020-12-171-5/+24
| | | | | | | | fixes #1637
* | JuttleLexer: Fix duplicate 'juttle' occurance in lexer aliases.Sumanth V Rao2020-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The output from pygments.lexers.get_all_lexers() contains 'juttle' twice in the aliases section for the Juttle lexer entry. This could be reproduced using: >>> from pygments.lexers import get_all_lexers >>> lexers = get_all_lexers() >>> {alias[0]: alias[1] for alias in lexers}.get('Juttle') ('juttle', 'juttle') This patch fixes the duplicate entry and generates the associated _mapping.py file. Fixes: #1604
* | Add Javascript 'async', 'await' keywords (#1605)Chris Nevers2020-11-171-1/+1
| |
* | all: remove "u" string prefix (#1536)Georg Brandl2020-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | * all: remove "u" string prefix * util: remove unirange Since Python 3.3, all builds are wide unicode compatible. * unistring: remove support for narrow-unicode builds which stopped being relevant with Python 3.3
* | Add comment.Matthäus G. Chajdas2020-09-061-0/+3
| | | | | | | | Add a quick reminder that Javascript doesn't need integers.
* | Overhaul Javascript numeric literals (#1534)Kurt McKee2020-09-061-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rename the "Javascript" tests to reflect that they are for CoffeeScript This change also modifies the module docstring to reflect the file's purpose. * Overhaul the Javascript numeric literal parsing Fixes #307 This patch contains the following changes: * Adds 50+ unit tests for Javascript numeric literals * Forces ASCII numbers for float literals (so, now reject `.୪`) * Adds support for Javascript's BigInt notation (`100n`) * Adds support for leading-zero-only octal notation (`0777`) * Adds support for scientific notation with no significand (`1e10`) Numeric literal parsing is based on information at: * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures
* | all: fixup remaining regexlint warningsGeorg Brandl2020-09-061-3/+3
| |
* | Update copyright year (fixes #1514.)Matthäus G. Chajdas2020-08-221-1/+1
|/
* Add recent keywords for Dart syntax (#1449)Sam Rawlins2020-05-181-9/+10
|
* Remove Python 2 compatibility (#1348)Georg Brandl2020-02-291-3/+3
| | | | | | | | | | | * Remove Python 2 compatibility * remove 2/3 shims in pygments.util * update setup.py metadata * Remove unneeded object inheritance. * Remove unneeded future imports.
* Add support for *.mjs JavaScript modules extension (#1392)Alan Hamlett2020-02-121-1/+1
|
* all: fixup http->https for github, pypi, pocoo etc URLsGeorg Brandl2019-12-101-1/+1
|
* tests: remove special skip cases for random_input test caseGeorg Brandl2019-12-091-3/+3
|
* Juttle: style fixesGeorg Brandl2019-11-261-7/+14
|
* Dart: add support for annotations (bitbucket PR #733)Georg Brandl2019-11-241-0/+1
|
* Fixup all headers and some more minor problems.2.4.2Georg Brandl2019-05-281-1/+1
|
* Add 'of' to TypeScript grammar (fixes #1515.)Matth?us G. Chajdas2019-05-181-1/+1
|
* Fix #1498.Matth?us G. Chajdas2019-03-061-6/+0
| | | | | .typoscript is used for TypoScript files, removing the ambiguity with TypeScript.