components/prism-clike.js


Log

Author Commit Date CI Message
Michael Schmidt e2630d89 2021-09-26T11:52:18 ESLint: Added `regexp/sort-alternatives` rule (#3093)
Michael Schmidt 79d22182 2021-06-08T13:50:35 FIxed some cases of quadratic worst-case runtime (#2922)
Michael Schmidt 0a3932fe 2020-12-30T17:43:57 C-like: Made all comments greedy (#2680)
Michael Schmidt e644178b 2020-12-28T18:19:11 Added test for polynomial backtracking (#2597)
Michael Schmidt 7db0cab3 2019-10-16T11:26:18 Minor improvements for C-like and Clojure (#2064) All changed patterns are equivalent with the exception of `c-like.class-name.pattern` where the `\b` before `catch` is new.
Michael Schmidt b520e1b6 2018-09-09T18:33:43 Simplify function pattern of C-like language (#1552) `/[a-z0-9_]/i` == `/\w/`
Golmote 571f2c50 2018-03-26T20:53:20 C-like: Make single-line comments greedy. Fix #1337. Make sure #1340 stays fixed.
Golmote cebacdfa 2018-03-08T23:14:40 Revert "C-like: Change order of comment patterns and make multi-line one greedy. Fix #1337" This reverts commit b98e5b9
Golmote 12c0b20a 2018-03-08T22:19:01 Decouple minus sign from number pattern in most languages. Close #1110
Golmote b98e5b9b 2018-03-07T20:53:45 C-like: Change order of comment patterns and make multi-line one greedy. Fix #1337
Golmote 5895978f 2017-10-22T14:21:31 C-like: Regexp simplification + don't use captures if not needed
Golmote 3426ed16 2017-09-09T11:47:23 C-like: Add support for unclosed block comments. Close #828
Valtteri Laitinen 8aa2cc4a 2017-05-08T13:56:50 Replace [\w\W] with [\s\S] and [0-9] with \d in regexes (#1107) * Replace [\w\W] with [^] and [0-9] with \d in regexes * Replace [\s\S] with [^] * Replace [^] with [\s\S]
Andreas Rohner 2705c509 2015-09-24T19:36:10 Partial solution for the "Comment-like substrings"-problem This patch introduces a new attribute called `greedy`. The attribute is a simple boolean flag. If there is no match for a greedy pattern it can concatenate the next two tokens into a single string and try to match on this string again. If a match is found on the second attempt, then the old tokens are deleted and replaced by the new match. This solves the "Comment-like substrings"-problem for exactly one comment at very little cost. With this patch the following code is highlighted correctly: "foo /* bar */ baz"; "foo // bar"; /lala"test"sdf/; This approach fails if there are more than one comments inside the string: "foo /* bar */ baz /* bar */ baz"; Signed-off-by: Andreas Rohner <andreas.rohner@gmx.net>
Golmote 792e35cf 2015-09-16T22:38:15 C-like: optimized string regexp
Golmote 071c3ddf 2015-09-04T00:13:37 Merge branch 'c-fixes' of https://github.com/rygorous/prism into gh-pages Conflicts: components/prism-c.js components/prism-c.min.js components/prism-clike.js components/prism-clike.min.js + added tests
Golmote 4d64d077 2015-09-04T00:11:44 Merge branch 'c-fixes' of https://github.com/rygorous/prism into gh-pages Conflicts: components/prism-c.js components/prism-c.min.js components/prism-clike.js components/prism-clike.min.js + added tests
Golmote 135ee9d1 2015-08-22T23:39:15 C-like: Improved operator regex + add != and !==
Golmote aa757f6c 2015-08-21T19:05:38 C-like: add word boundary before class-name prefixes
Golmote d4194c93 2015-07-11T18:56:55 C-like: use look-ahead instead of inside to match functions
Golmote b6535ddb 2015-07-10T08:07:05 C-like: removed unused 'ignore' pattern.
Golmote 15760e18 2015-07-08T20:23:32 C-like and CSS: Fixes for \r\n
Golmote 670d5afe 2015-06-28T02:33:28 Regression fix: do not allow multi-line strings in C-like (unless properly escaped)
Golmote 476cbf42 2015-06-20T20:06:39 Improved regex performance of C-like strings and JS regexps
Golmote 2781c8b9 2015-04-10T21:36:06 Allow empty single-like comments. Fix #564
Golmote b1fd5bdc 2015-03-10T08:27:53 Removed unused global flag in all grammars
Golmote 0ad98acc 2015-03-10T08:01:29 Simplify C-Like comment pattern
Golmote 07562bd5 2015-01-11T20:42:46 Merge branch 'master' into prism-multiline-strings Conflicts: components/prism-clike.min.js
Golmote 9487b5be 2015-01-09T08:11:21 Removed unneeded escapes in RegExps, added some semicolons
Golmote 3aeecb5a 2014-12-10T23:21:22 Add multiline strings support to C-like
Andreas Rohner 1724e7a1 2014-08-11T08:26:48 Use the new array syntax for clike and coffeescript This patch uses the new array syntax for the `clike` language and for `coffeescript`. For `clike` it fixes a minor bug, whereby The character immediately in front of a single line comment is highlighted as a comment as well. something// something This is because both definitions for single and multiline comments have to be matched with a single regex and the `lookbehind` parameter can only be applied to the first captured string. For `coffeescript` the previously used `block-comment` token name is no longer necessary.
Thomas Ingram ad7513cb 2014-05-24T13:06:57 Attempt to fix clike and markup grammars Original authors should at least verify these changes are correct
Bart Veneman 3c9155e6 2013-08-04T10:52:21 Added throw keyword to c-like and javascript
Fabian Giesen a418b1a8 2013-07-25T19:25:51 C-like: Allow '+' in exponents.
Miles Johnson 29e51df1 2013-07-03T12:16:14 Fixed clike greater than or equals
Miles Johnson 5c7d8061 2013-07-03T02:09:37 Polish fixes according to test cases
Miles Johnson 0c8c1789 2013-07-02T18:18:07 Quick fixes Removed PHP from examples
Miles Johnson a2db2b5c 2013-07-02T16:54:46 Added legit markup support
Lea Verou 08143d9f 2013-05-19T00:12:57 Merge branch 'regex-number' of https://github.com/mseeboeck/prism into mseeboeck-regex-number Conflicts: components/prism-clike.js components/prism-clike.min.js prism.js
Lea Verou d7f40d6c 2013-05-18T07:24:36 Merge pull request #91 from williammalo/gh-pages C-like syntax (or at least javascript) is missing some operators.
Miles Johnson 3129ed87 2013-05-17T16:57:08 More example testing
Miles Johnson 45a54837 2013-05-16T21:08:06 Moved function to clike
Miles Johnson b1003de3 2013-05-16T12:19:58 More improvements and testing
Miles Johnson 15c80635 2013-05-14T12:03:58 Added class-name to clike Added PHP support
Gregor Martynus cf604b71 2013-05-14T00:23:55 Fix to allow clike languages like JavaScript to start with `//` comments, but still ignoring URLs like http://example.com
Gregor Martynus 4615e490 2013-05-11T12:27:50 I had a problem with syntax highlighting of JavaScript when it starts with a `// comment`. The problem of the comment pattern was ``` /(^|[^\\])(\/\*[\w\W]*?\*\/|[^:]\/\/.*?(\r?\n|$))/g ^^^^ ``` And I'm not sure what it is for, exactly? Adding a `?` to it fixes the problem for me, but I hope that it doesn't cause problems with other use case. Could you look into it? Is there any test suite for the existing code?
william malo 8779ba84 2013-05-10T16:32:07 Added missing operators for c-like languages
Nicolas Gryman 503209ac 2013-03-25T23:33:17 fixed URLs in strings.
mseeboeck ad010eac 2012-12-18T00:18:43 Changed regex Prism.languages.clike.number Changes: * Variable names matching /[a-f]+/ are no longer treated as numbers. * Added support for upper case and scientific notation. * Also changed corresponding files in /components. Minor issues: * No support for type suffixes (e.g. 300f for float). * Leading decimal point is marked up as 'punctuation', instead as part of * the number (e.g. .1; 0.1 is matched correctly).
Lea Verou 1cdfcb84 2012-11-11T04:25:56 Fixed #37
Lea Verou 1b40db97 2012-11-10T00:23:33 Made Java & JavaScript inherit from a generic C-style language definition; Added methods for language definition inheritance; Added simple dependency management in downloader