Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It honks #191

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6da8ac9
[honk] stub out build targets
anp Aug 29, 2020
40f42cc
[honk] boilerplate vscode extension
anp Aug 29, 2020
e2bcd83
[dom][examples] switch to console_error_panic_hook
anp Aug 29, 2020
cf36f39
[ts-bindgen] initial impl bits
anp Aug 30, 2020
29d648a
[ts-bindgen] reorganize crate
anp Aug 30, 2020
37a789d
[ts-bindgen] start of an IR for TS types
anp Sep 4, 2020
12fe94f
[ts-bindgen] begging of ctors and methods, better Debug impls
anp Sep 4, 2020
db3cc4d
[ts-bindgen] unify ctor and function types, improve module debug
anp Sep 4, 2020
2ba1083
[ts-bindgen] handle async/generator functions
anp Sep 4, 2020
3d387b8
[ts-bindgen] modules have functions
anp Sep 4, 2020
5b09cac
[ts-bindgen] start splitting typescript into submodules, starting wit…
anp Sep 4, 2020
2c87f79
[ts-bindgen] finish splitting typescript.rs up
anp Sep 4, 2020
2abba30
[ts-bindgen] start distinguishing between mvp and future work
anp Sep 4, 2020
9e4a163
[ts-bindgen] remove glob imports from ast crate
anp Sep 4, 2020
660b234
[ts-bindgen] finish variables in modules
anp Sep 4, 2020
fbd9393
[ts-bindgen] start adding interfaces in modules
anp Sep 4, 2020
80f2084
[ts-bindgen] move names into modules
anp Sep 4, 2020
89d007a
[ts-bindgen] aliases
anp Sep 4, 2020
13e3795
[ts-bindgen] remove old todo
anp Sep 4, 2020
63abb32
[ts-bindgen] compact module.rs
anp Sep 4, 2020
451a0ef
[ts-bindgen] identify which type variants we need to support for vscode
anp Sep 4, 2020
897868c
[ts-bindgen] start implementing basic Ty's
anp Sep 4, 2020
6fb2de3
[ts-bindgen] fn and ctor types
anp Sep 5, 2020
51c4abf
[ts-bindgen] almost the rest of the parsing owl
anp Sep 5, 2020
554c58c
[ts-bindgen] class properties
anp Sep 5, 2020
c2cd2cc
inline unnecessarily outlined function
anp Sep 5, 2020
95edf7c
[ts-bindgen] classes have type parameters
anp Sep 5, 2020
313cb6f
[ts-bindgen] functions know if they're constructors
anp Sep 5, 2020
f0a31f3
[ts-bindgen] functions have type params
anp Sep 5, 2020
c9fb1ce
[ts-bindge] type params for names
anp Sep 5, 2020
c9c9482
[ts-bindgen] add golden file tests, add rustfmt to codegen
anp Sep 6, 2020
aa2c957
[ts-bindgen] align debug output with source language
anp Sep 6, 2020
883abfc
[ts-bindgen] make sure golden rust files build
anp Sep 6, 2020
38d407b
[ts-bindgen] add first golden test (failing)
anp Sep 6, 2020
50b9c64
[ts-bindgen] initial totokens impls
anp Sep 6, 2020
691cb5f
[ts-bindgen] get modules compiling ok
anp Sep 6, 2020
db7f91c
[project] add list of crates to repo readme
anp Sep 7, 2020
3ef10d0
[honk][vscode] switch the boilerplate to a tree data provider
anp Sep 7, 2020
4b3eb4c
[ts-bindgen] start switching strategies to generating webidl
anp Sep 7, 2020
54babe9
[honk][vscode] initial code-sys crate (doesn't build)
anp Sep 7, 2020
ae4e602
[honk][vscode] add lib.rs (oops)
anp Sep 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[ts-bindgen] aliases
anp committed Sep 4, 2020
commit 89d007ad8fb363c380838eb5676d4a36fac1e2fa
8 changes: 5 additions & 3 deletions dom/ts-bindgen/src/typescript/module.rs
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ use super::{class::Class, enums::Enum, func::Func, interface::Interface, name::N

pub struct TsModule {
variables: BTreeMap<Name, Ty>,
aliases: BTreeMap<Name, Ty>,
enums: BTreeMap<Name, Enum>,
classes: BTreeMap<Name, Class>,
interfaces: BTreeMap<Name, Interface>,
@@ -45,6 +46,7 @@ impl From<Module> for TsModule {
impl TsModule {
fn blank() -> Self {
Self {
aliases: Default::default(),
children: Default::default(),
classes: Default::default(),
interfaces: Default::default(),
@@ -161,11 +163,11 @@ impl TsModule {
}

fn add_interface(&mut self, interface: TsInterfaceDecl) {
self.interfaces.insert(Name::from(interface.id.sym.to_string()), interface.body.into());
self.interfaces.insert(interface.id.sym.to_string().into(), interface.body.into());
}

fn add_alias(&mut self, _alias: TsTypeAliasDecl) {
println!("TODO ts aliases");
fn add_alias(&mut self, alias: TsTypeAliasDecl) {
self.aliases.insert(alias.id.sym.to_string().into(), From::from(*alias.type_ann));
}

fn add_enum(&mut self, decl: TsEnumDecl) {