-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port all babel-parser changes from 2018-07-10 to 2018-09-28
In chronological order: 301db1b92 TypeScript: Support type arguments on JSX opening and self-closing tags (#7799) ✅ Required a different implementation since JSX parsing has changed so much. b89234b1a v7.0.0-beta.53 🚫 Release only. 84282f199 v7.0.0-beta.54 🚫 Release only. 8b10a44fe remove .then from dynamic import parser exception message (#8355) 🚫 Error message only. a811cf78e Correctly parse interface methods named 'static' (#8374) ✅ Ported the fix, though the test case wasn't breaking for me before. 8ee24fdfc TypeScript: Support type arguments on tagged templates (#7754) ✅ Ported change over with new test. adca165ee v7.0.0-beta.55 🚫 Release only. 55ca90b3f Allow TSInterfaceDeclaration to be default export (#8408) ✅ Ported with a test and a few modifications. 5c728ea60 Fix private property parsing in Flow (#8340) ✅ Added a test, but the code paths were already consolidated. 6695f5e2f v7.0.0-beta.56 🚫 Release only. 8b1406127 v7.0.0-rc.0 🚫 Release only. 0a958861c v7.0.0-rc.1 🚫 Release only. d79b5eeef Require decoratorsBeforeExport option for decorators (#8465) 🚫 Only affects plugin system. ab8555a86 Update dependencies (#8364) ✅ Already working as expected in sucrase. b439013cd Fix trailingComments for FunctionExpression that is CallExpression arguments (#8488) 🚫 Comments aren't tracked in Sucrase. f1d774b34 v7.0.0-rc.2 🚫 Release only. cada040be v7.0.0-rc.3 🚫 Release only. 589994015 Update parser whitespace for clarity (#8539) ✅ Ported refactor. 524d84776 Flatten TokenType class hierarchy (#8537) 🚫 Not relevant in Sucrase. 72ee1816a Update to ES6 String methods (#8541) 🚫 Relevant code was removed from Sucrase. edbffda09 Cleanup getLineInfo (#8540) 🚫 Relevant code was removed from Sucrase. 814c564c4 v7.0.0-rc.4 🚫 Release only. 90fb82a53 v7.0.0 🚫 Release only. 04d09cc75 add access public to all packages (#8573) 🚫 package.json only. 9d244ae66 More helpful error message for missing decoratorsBeforeExport in parser (#8576) 🚫 Error message only. 6893b7e7d fix: consistent naming 🚫 Types only. fc9becfdf Merge pull request #8170 from AviVahl/master 🚫 Merge commit. 07fae82a8 fix(types): missing `unambiguous` sourceType (#8610) 🚫 Types only. 58017044a Bump flow to 0.80 and fix sourceType error (#8630) 🚫 Types only. 79b2af599 Format fixture JSON with Prettier. (#8658) 🚫 Formatting only. 380f2a029 Fix typescript parsing typed object shorthand methods (#8677) 🚫 Already applied in a previous bug fix. 9b4b436e1 Fix parsing of newline between 'async' and 'function' (#8698) ✅ Added a test, but I didn't port the code since I think this is obscure and will be hard to implement right in Sucrase. fad74959f v7.1.0 🚫 Release only. 38cf318f6 Bump lint-related deps (#8765) 🚫 Lint only. f38be1311 TypeScript: reserve `unknown` as TSUnknownKeyword (#8755) 🚫 Not relevant for Sucrase. ead23d711 v7.1.1 🚫 Release only. 3f5b7554b v7.1.2 🚫 Release only.
- Loading branch information
1 parent
972f407
commit d6c2090
Showing
12 changed files
with
176 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,36 @@ | ||
// Matches a whole line break (where CRLF is considered a single | ||
// line break). Used to count lines. | ||
import {charCodes} from "./charcodes"; | ||
|
||
export const lineBreak = /\r\n?|\n|\u2028|\u2029/; | ||
|
||
export const nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; | ||
// https://tc39.github.io/ecma262/#sec-white-space | ||
export function isWhitespace(code: number): boolean { | ||
switch (code) { | ||
case 0x0009: // CHARACTER TABULATION | ||
case 0x000b: // LINE TABULATION | ||
case 0x000c: // FORM FEED | ||
case charCodes.space: | ||
case charCodes.nonBreakingSpace: | ||
case charCodes.oghamSpaceMark: | ||
case 0x2000: // EN QUAD | ||
case 0x2001: // EM QUAD | ||
case 0x2002: // EN SPACE | ||
case 0x2003: // EM SPACE | ||
case 0x2004: // THREE-PER-EM SPACE | ||
case 0x2005: // FOUR-PER-EM SPACE | ||
case 0x2006: // SIX-PER-EM SPACE | ||
case 0x2007: // FIGURE SPACE | ||
case 0x2008: // PUNCTUATION SPACE | ||
case 0x2009: // THIN SPACE | ||
case 0x200a: // HAIR SPACE | ||
case 0x202f: // NARROW NO-BREAK SPACE | ||
case 0x205f: // MEDIUM MATHEMATICAL SPACE | ||
case 0x3000: // IDEOGRAPHIC SPACE | ||
case 0xfeff: // ZERO WIDTH NO-BREAK SPACE | ||
return true; | ||
|
||
default: | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters