Title: [248922] trunk/Source/WebInspectorUI
Revision
248922
Author
pecor...@apple.com
Date
2019-08-20 16:44:39 -0700 (Tue, 20 Aug 2019)

Log Message

Web Inspector: Update CodeMirror to support numeric separators in _javascript_ numbers
https://bugs.webkit.org/show_bug.cgi?id=200942

Cherry-pick a few CodeMirror changes:

    [_javascript_ mode] Support numeric separators
    https://github.com/codemirror/CodeMirror/commit/beab8ed123683416bfec934df73d13401ec086b5#diff-9812850bb71d31e8dd60b476abb2bae8

    [_javascript_ mode] fix tokenizing of underscore properties
    https://github.com/codemirror/CodeMirror/commit/463ea2c34ab442c0cae1d9732305219ca9b04dfe#diff-9812850bb71d31e8dd60b476abb2bae8

Reviewed by Timothy Hatcher.

* UserInterface/External/CodeMirror/_javascript_.js:

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (248921 => 248922)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-08-20 23:13:17 UTC (rev 248921)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-08-20 23:44:39 UTC (rev 248922)
@@ -1,3 +1,20 @@
+2019-08-20  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Update CodeMirror to support numeric separators in _javascript_ numbers
+        https://bugs.webkit.org/show_bug.cgi?id=200942
+
+        Cherry-pick a few CodeMirror changes:
+        
+            [_javascript_ mode] Support numeric separators
+            https://github.com/codemirror/CodeMirror/commit/beab8ed123683416bfec934df73d13401ec086b5#diff-9812850bb71d31e8dd60b476abb2bae8
+
+            [_javascript_ mode] fix tokenizing of underscore properties
+            https://github.com/codemirror/CodeMirror/commit/463ea2c34ab442c0cae1d9732305219ca9b04dfe#diff-9812850bb71d31e8dd60b476abb2bae8
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/External/CodeMirror/_javascript_.js:
+
 2019-08-20  Devin Rousso  <drou...@apple.com>
 
         Web Inspector: Sources: move the resource type scope bar to be next to the filter

Modified: trunk/Source/WebInspectorUI/UserInterface/External/CodeMirror/_javascript_.js (248921 => 248922)


--- trunk/Source/WebInspectorUI/UserInterface/External/CodeMirror/_javascript_.js	2019-08-20 23:13:17 UTC (rev 248921)
+++ trunk/Source/WebInspectorUI/UserInterface/External/CodeMirror/_javascript_.js	2019-08-20 23:44:39 UTC (rev 248922)
@@ -104,7 +104,7 @@
     if (ch == '"' || ch == "'") {
       state.tokenize = tokenString(ch);
       return state.tokenize(stream, state);
-    } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) {
+    } else if (ch == "." && stream.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) {
       return ret("number", "number");
     } else if (ch == "." && stream.match("..")) {
       return ret("spread", "meta");
@@ -112,10 +112,10 @@
       return ret(ch);
     } else if (ch == "=" && stream.eat(">")) {
       return ret("=>", "operator");
-    } else if (ch == "0" && stream.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i)) {
+    } else if (ch == "0" && stream.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {
       return ret("number", "number");
     } else if (/\d/.test(ch)) {
-      stream.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/);
+      stream.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);
       return ret("number", "number");
     } else if (ch == "/") {
       if (stream.eat("*")) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to