-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Add new language option: JavaScript - for this language we won't emit any type information in the generated artifacts. Next diff in stack will change the configuration of the compiler to explicitly specify the language. Reviewed By: josephsavona Differential Revision: D35049339 fbshipit-source-id: 39be62a597d9b8cbdaeb644994941d2a1867e766
- Loading branch information
1 parent
72004cf
commit 901d657
Showing
9 changed files
with
115 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
use crate::writer::{Writer, AST}; | ||
|
||
use std::fmt::{Result as FmtResult, Write}; | ||
|
||
#[derive(Default)] | ||
pub struct JavaScriptPrinter { | ||
result: String, | ||
} | ||
|
||
impl Write for JavaScriptPrinter { | ||
fn write_str(&mut self, s: &str) -> FmtResult { | ||
self.result.write_str(s) | ||
} | ||
} | ||
|
||
impl Writer for JavaScriptPrinter { | ||
fn into_string(self: Box<Self>) -> String { | ||
self.result | ||
} | ||
|
||
fn write(&mut self, _ast: &AST) -> FmtResult { | ||
Ok(()) | ||
} | ||
|
||
fn get_runtime_fragment_import(&self) -> &'static str { | ||
"" | ||
} | ||
|
||
fn write_local_type(&mut self, _name: &str, _value: &AST) -> FmtResult { | ||
Ok(()) | ||
} | ||
|
||
fn write_export_type(&mut self, _name: &str, _value: &AST) -> FmtResult { | ||
Ok(()) | ||
} | ||
|
||
fn write_import_module_default(&mut self, _name: &str, _from: &str) -> FmtResult { | ||
Ok(()) | ||
} | ||
|
||
fn write_import_type(&mut self, _types: &[&str], _from: &str) -> FmtResult { | ||
Ok(()) | ||
} | ||
|
||
fn write_import_fragment_type(&mut self, _types: &[&str], _from: &str) -> FmtResult { | ||
Ok(()) | ||
} | ||
|
||
fn write_export_fragment_type(&mut self, _old_name: &str, _new_name: &str) -> FmtResult { | ||
Ok(()) | ||
} | ||
|
||
fn write_export_fragment_types( | ||
&mut self, | ||
_fragment_type_name_1: &str, | ||
_fragment_type_name_2: &str, | ||
) -> FmtResult { | ||
Ok(()) | ||
} | ||
|
||
fn write_any_type_definition(&mut self, _name: &str) -> FmtResult { | ||
Ok(()) | ||
} | ||
} |
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