From d78be9ac6c02910bbf8ac71118e68adff4fdc570 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Tue, 21 May 2019 13:24:30 -0700 Subject: Remove old import/export parsing routines (NFC) (#2127) These formats don't seem to be used now. --- src/wasm/wasm-s-parser.cpp | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'src') diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index e8ea05f77..6e9986bb1 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -1845,20 +1845,6 @@ void SExpressionWasmBuilder::parseExport(Element& s) { } else { throw ParseException("invalid export"); } - } else if (!s[2]->dollared() && !std::isdigit(s[2]->str()[0])) { - ex->value = s[3]->str(); - if (s[2]->str() == MEMORY) { - if (!wasm.memory.exists) { - throw ParseException("memory exported but no memory"); - } - ex->kind = ExternalKind::Memory; - } else if (s[2]->str() == TABLE) { - ex->kind = ExternalKind::Table; - } else if (s[2]->str() == GLOBAL) { - ex->kind = ExternalKind::Global; - } else { - throw ParseException("invalid ext export"); - } } else { // function ex->value = s[2]->str(); @@ -1919,18 +1905,7 @@ void SExpressionWasmBuilder::parseImport(Element& s) { throw ParseException("invalid import"); } } - if (!s[i]->quoted()) { - if (s[i]->str() == MEMORY) { - kind = ExternalKind::Memory; - } else if (s[i]->str() == TABLE) { - kind = ExternalKind::Table; - } else if (s[i]->str() == GLOBAL) { - kind = ExternalKind::Global; - } else { - throw ParseException("invalid ext import"); - } - i++; - } else if (!newStyle) { + if (!newStyle) { kind = ExternalKind::Function; } auto module = s[i++]->str(); -- cgit v1.2.3