@@ -1845,20 +1845,6 @@ void SExpressionWasmBuilder::parseExport(Element& s) {
18451845 } else {
18461846 throw ParseException (" invalid export" );
18471847 }
1848- } else if (!s[2 ]->dollared () && !std::isdigit (s[2 ]->str ()[0 ])) {
1849- ex->value = s[3 ]->str ();
1850- if (s[2 ]->str () == MEMORY) {
1851- if (!wasm.memory .exists ) {
1852- throw ParseException (" memory exported but no memory" );
1853- }
1854- ex->kind = ExternalKind::Memory;
1855- } else if (s[2 ]->str () == TABLE) {
1856- ex->kind = ExternalKind::Table;
1857- } else if (s[2 ]->str () == GLOBAL) {
1858- ex->kind = ExternalKind::Global;
1859- } else {
1860- throw ParseException (" invalid ext export" );
1861- }
18621848 } else {
18631849 // function
18641850 ex->value = s[2 ]->str ();
@@ -1919,18 +1905,7 @@ void SExpressionWasmBuilder::parseImport(Element& s) {
19191905 throw ParseException (" invalid import" );
19201906 }
19211907 }
1922- if (!s[i]->quoted ()) {
1923- if (s[i]->str () == MEMORY) {
1924- kind = ExternalKind::Memory;
1925- } else if (s[i]->str () == TABLE) {
1926- kind = ExternalKind::Table;
1927- } else if (s[i]->str () == GLOBAL) {
1928- kind = ExternalKind::Global;
1929- } else {
1930- throw ParseException (" invalid ext import" );
1931- }
1932- i++;
1933- } else if (!newStyle) {
1908+ if (!newStyle) {
19341909 kind = ExternalKind::Function;
19351910 }
19361911 auto module = s[i++]->str ();
0 commit comments