Linus Groh
e80217a746
LibJS: Unify syntax highlighting
...
So far we have three different syntax highlighters for LibJS:
- js's Line::Editor stylization
- JS::MarkupGenerator
- GUI::JSSyntaxHighlighter
This not only caused repetition of most token types in each highlighter
but also a lot of inconsistency regarding the styling of certain tokens:
- JSSyntaxHighlighter was considering TokenType::Period to be an
operator whereas MarkupGenerator categorized it as punctuation.
- MarkupGenerator was considering TokenType::{Break,Case,Continue,
Default,Switch,With} control keywords whereas JSSyntaxHighlighter just
disregarded them
- MarkupGenerator considered some future reserved keywords invalid and
others not. JSSyntaxHighlighter and js disregarded most
Adding a new token type meant adding it to ENUMERATE_JS_TOKENS as well
as each individual highlighter's switch/case construct.
I added a TokenCategory enum, and each TokenType is now associated to a
certain category, which the syntax highlighters then can use for styling
rather than operating on the token type directly. This also makes
changing a token's category everywhere easier, should we need to do that
(e.g. I decided to make TokenType::{Period,QuestionMarkPeriod}
TokenCategory::Operator for now, but we might want to change them to
Punctuation.
2020-10-04 23:41:31 +02:00
..
2020-09-25 21:18:17 +02:00
2020-09-15 21:46:26 +02:00
2020-09-15 21:46:26 +02:00
2020-09-24 21:35:47 +02:00
2020-08-27 18:36:31 +02:00
2020-09-25 23:55:33 +02:00
2020-09-24 21:14:14 +02:00
2020-08-27 15:38:02 +02:00
2020-08-25 09:46:28 +02:00
2020-09-25 21:18:17 +02:00
2020-08-22 13:10:14 +02:00
2020-08-15 13:45:08 +02:00
2020-09-15 21:46:26 +02:00
2020-09-25 21:18:17 +02:00
2020-07-04 17:25:31 +02:00
2020-09-25 21:18:17 +02:00
2020-08-23 11:22:21 +02:00
2020-08-22 11:54:30 +02:00
2020-09-11 18:42:43 +02:00
2020-10-02 15:38:07 +02:00
2020-09-23 21:45:28 +02:00
2020-09-30 21:46:59 +02:00
2020-09-11 14:51:02 +02:00
2020-10-02 16:03:17 +02:00
2020-09-26 19:55:54 +02:00
2020-09-28 12:27:56 +02:00
2020-09-24 21:35:47 +02:00
2020-09-25 21:18:17 +02:00
2020-08-21 21:16:13 +02:00
2020-09-30 21:46:59 +02:00
2020-07-20 21:03:48 +02:00
2020-07-20 21:03:48 +02:00
2020-09-30 21:46:59 +02:00
2020-09-25 21:18:17 +02:00
2020-08-17 17:47:14 +02:00
2020-08-17 17:47:14 +02:00
2020-08-16 16:37:39 +02:00
2020-08-05 22:33:42 +02:00
2020-07-04 17:25:31 +02:00
2020-09-13 21:41:45 +02:00
2020-09-18 21:29:01 +02:00
2020-08-12 20:41:13 +02:00
2020-09-16 21:08:55 +02:00
2020-08-13 20:18:11 +02:00
2020-09-24 11:30:14 +02:00
2020-09-24 11:30:14 +02:00
2020-08-16 16:44:09 +02:00
2020-08-16 16:44:09 +02:00
2020-08-15 00:05:45 +02:00
2020-09-25 21:18:17 +02:00
2020-08-26 00:51:35 +02:00
2020-08-26 00:51:35 +02:00
2020-09-25 21:18:17 +02:00
2020-07-14 17:55:39 +02:00
2020-09-20 20:54:23 +02:00
2020-08-26 17:00:40 +02:00
2020-09-25 21:18:17 +02:00
2020-09-24 21:35:47 +02:00
2020-09-24 21:35:47 +02:00
2020-07-23 17:43:44 +02:00
2020-07-23 17:31:08 +02:00
2020-09-25 21:18:17 +02:00
2020-07-18 16:27:57 +02:00
2020-07-16 16:10:21 +02:00
2020-08-29 17:42:03 +02:00
2020-09-20 21:10:46 +02:00
2020-09-20 21:10:46 +02:00
2020-10-04 23:41:31 +02:00
2020-08-24 19:15:07 +02:00
2020-09-25 20:41:30 +02:00
2020-09-25 21:18:17 +02:00
2020-09-15 21:46:26 +02:00
2020-09-15 21:46:26 +02:00
2020-09-24 21:35:47 +02:00
2020-09-15 21:43:29 +02:00
2020-09-25 21:18:17 +02:00
2020-10-02 15:38:07 +02:00
2020-07-28 16:29:44 +02:00
2020-07-11 11:45:49 +02:00
2020-07-11 11:45:49 +02:00
2020-09-25 21:18:17 +02:00
2020-07-16 16:10:21 +02:00
2020-08-13 20:18:11 +02:00
2020-08-16 16:44:09 +02:00
2020-08-28 20:50:12 +02:00
2020-08-16 16:44:09 +02:00
2020-08-16 16:44:09 +02:00
2020-08-16 16:44:09 +02:00
2020-07-13 19:49:34 +02:00
2020-09-25 21:18:17 +02:00
2020-08-16 16:44:09 +02:00
2020-08-16 16:44:09 +02:00
2020-09-25 21:18:17 +02:00
2020-09-17 16:17:14 +02:00
2020-09-25 21:18:17 +02:00
2020-07-26 17:51:00 +02:00
2020-07-26 17:51:00 +02:00
2020-09-25 21:18:17 +02:00
2020-09-11 14:47:38 +02:00
2020-08-16 16:44:09 +02:00
2020-08-16 16:44:09 +02:00
2020-08-12 11:02:30 +02:00
2020-09-25 21:18:17 +02:00
2020-09-25 21:18:17 +02:00
2020-08-25 20:20:45 +02:00
2020-10-04 23:12:28 +02:00
2020-09-30 20:05:24 +02:00
2020-08-19 21:17:02 +02:00
2020-09-25 21:18:17 +02:00
2020-09-19 16:45:51 +02:00
2020-09-25 21:18:17 +02:00
2020-09-24 11:29:21 +02:00
2020-09-24 11:29:21 +02:00
2020-09-23 20:44:23 +02:00
2020-09-23 20:44:23 +02:00
2020-09-11 14:26:37 +02:00
2020-08-27 10:42:15 +02:00
2020-09-18 21:29:01 +02:00
2020-08-31 09:08:26 +02:00
2020-08-31 09:08:26 +02:00
2020-09-30 20:05:24 +02:00
2020-09-24 21:35:47 +02:00
2020-08-28 21:02:46 +02:00
2020-09-15 21:46:26 +02:00
2020-09-15 21:46:26 +02:00
2020-09-25 21:18:17 +02:00
2020-09-30 21:46:59 +02:00
2020-09-30 21:46:59 +02:00
2020-09-30 21:46:59 +02:00
2020-09-30 21:46:59 +02:00
2020-09-25 21:18:17 +02:00
2020-09-25 21:18:17 +02:00
2020-09-25 21:18:17 +02:00
2020-10-03 19:43:25 +02:00
2020-10-03 14:01:37 +02:00
2020-09-18 21:29:01 +02:00
2020-09-18 21:29:01 +02:00
2020-09-25 21:18:17 +02:00
2020-10-03 19:47:56 +02:00
2020-09-25 20:41:30 +02:00
2020-09-15 21:46:26 +02:00
2020-09-15 21:46:26 +02:00
2020-08-22 13:11:25 +02:00
2020-07-15 17:15:45 +02:00