src/core.js
// import * as IDENTIFIER from "MODULE"
import * as IDENTIFIER from "MODULE"
import * as IDENTIFIER from " MODULE "
function handleImport() {
    LOOKING_FOR = "import names";
    const braceStart = str.indexWithin("{", pos + 7, DISTANCE, false);
    if (braceStart === -1) {
      return handleImportStar();
    }
    const braceEnd = str.indexWithin("}", braceStart + 1, lenDestructure);
    LOOKING_FOR = "name of imported module";
    let moduleStart = str.indexWithin("from ", braceEnd + 1, DISTANCE);
    moduleStart = str.indexWithin(quote, moduleStart + 1, 5);
    const moduleEnd = str.indexWithin(quote, moduleStart + 1, lenModuleName);
    start = moduleEnd + 1;
    return {
      type: "import",
      start: pos,
      end: moduleEnd,
      modules: destructureModules(str.slice(braceStart, braceEnd + 1)),
      moduleName: str.slice(moduleStart, moduleEnd + 1)
    };
  }
function handleImport ( ) { LOOKING_FOR = "import names" ; const braceStart = str . indexWithin ( "{" , pos + 7 , DISTANCE , false ) ; if ( braceStart === - 1 ) { return handleImportStar ( ) ; } const braceEnd = str . indexWithin ( "}" , braceStart + 1 , lenDestructure ) ; LOOKING_FOR = "name of imported module" ; let moduleStart = str . indexWithin ( "from " , braceEnd + 1 , DISTANCE ) ; moduleStart = str . indexWithin ( quote , moduleStart + 1 , 5 ) ; const moduleEnd = str . indexWithin ( quote , moduleStart + 1 , lenModuleName ) ; start = moduleEnd + 1 ; return { type : "import" , start : pos , end : moduleEnd , modules : destructureModules ( str . slice ( braceStart , braceEnd + 1 ) ) , moduleName : str . slice ( moduleStart , moduleEnd + 1 ) } ; }
import * as IDENTIFIER from "MODULE"
import * as IDENTIFIER from " MODULE "
// 7 === "import ".length // try to see if it's `import *`