diff --git a/ets2panda/util/diagnostic/fatal.yaml b/ets2panda/util/diagnostic/fatal.yaml index 5cd41417335a7e0d709bd20cf07461d914a844cd..2994683e1197f857ae081c319eeefcb55ce764d0 100644 --- a/ets2panda/util/diagnostic/fatal.yaml +++ b/ets2panda/util/diagnostic/fatal.yaml @@ -50,7 +50,7 @@ fatal: - name: UNKNOWN_EXT id: 10 - message: "Unknown extension of sourcefile, set the '--extension' option or change the file extension (available options: js, ts, as, ets)" + message: "Unknown extension of sourcefile, set the '--extension' option or change the file extension (available options: ets)" - name: JS_UNSUPPORTED id: 11 diff --git a/ets2panda/util/options.cpp b/ets2panda/util/options.cpp index 82dc27f031d73a9ca3cd4ab534eeddcc69b0096a..0569ff3a666456d78690f38d6637973afd1c81d8 100644 --- a/ets2panda/util/options.cpp +++ b/ets2panda/util/options.cpp @@ -371,6 +371,11 @@ bool Options::DetermineExtension() } return true; } + case ScriptExtension::AS: + case ScriptExtension::TS: { + diagnosticEngine_.LogDiagnostic(diagnostic::UNKNOWN_EXT, util::DiagnosticMessageParams {}); + return false; + } default: return true; } diff --git a/ets2panda/util/options.yaml b/ets2panda/util/options.yaml index 7b57d1927b23350f838198eb625cc14bcfbc8b6e..af4b0e3bb2f6c06e54d4452c63ff5773d58f4501 100644 --- a/ets2panda/util/options.yaml +++ b/ets2panda/util/options.yaml @@ -37,7 +37,8 @@ options: - ts - as - ets - possible_values: *ScriptExtension + possible_values: + - ets - name: module type: bool