file_path stringlengths 3 280 | file_language stringclasses 66
values | content stringlengths 1 1.04M | repo_name stringlengths 5 92 | repo_stars int64 0 154k | repo_description stringlengths 0 402 | repo_primary_language stringclasses 108
values | developer_username stringlengths 1 25 | developer_name stringlengths 0 30 | developer_company stringlengths 0 82 |
|---|---|---|---|---|---|---|---|---|---|
crates/swc_css_prefixer/tests/fixture/tab-size/output.css | CSS | .class {
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/tab-size/output.defaults-not-ie-11.css | CSS | .class {
tab-size: 2;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-align-last/input.css | CSS | .class {
text-align-last: left;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-align-last/output.css | CSS | .class {
-moz-text-align-last: left;
text-align-last: left;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-align-last/output.defaults-not-ie-11.css | CSS | .class {
text-align-last: left;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-decoration/input.css | CSS | .shorthand {
text-decoration: overline double red;
}
.full {
text-decoration-style: double;
}
.old {
text-decoration: underline;
}
.global {
text-decoration: unset;
}
.skip {
text-decoration-skip: spaces;
}
.ink-auto {
text-decoration-skip-ink: auto;
}
.ink-all {
text-decoration-skip-i... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-decoration/output.css | CSS | .shorthand {
-webkit-text-decoration: overline double red;
-moz-text-decoration: overline double red;
text-decoration: overline double red;
}
.full {
-webkit-text-decoration-style: double;
-moz-text-decoration-style: double;
text-decoration-style: double;
}
.old {
text-decoration: underline;
}
.global {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-decoration/output.defaults-not-ie-11.css | CSS | .shorthand {
-webkit-text-decoration: overline double red;
text-decoration: overline double red;
}
.full {
text-decoration-style: double;
}
.old {
text-decoration: underline;
}
.global {
text-decoration: unset;
}
.skip {
-webkit-text-decoration-skip: spaces;
text-decoration-skip: spaces;
}
.ink-auto {
-... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-emphasis/input.css | CSS | .class {
text-emphasis: none;
}
.class {
text-emphasis: filled red;
-webkit-text-emphasis: filled red;
}
.class {
text-emphasis-position: left;
}
.class {
text-emphasis-style: circle;
}
.class {
text-emphasis-color: red;
}
a {
text-emphasis-position: over left;
}
em {
text-emphasis... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-emphasis/output.css | CSS | .class {
-webkit-text-emphasis: none;
text-emphasis: none;
}
.class {
text-emphasis: filled red;
-webkit-text-emphasis: filled red;
}
.class {
-webkit-text-emphasis-position: left;
text-emphasis-position: left;
}
.class {
-webkit-text-emphasis-style: circle;
text-emphasis-style: circle;
}
.class {
-we... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-emphasis/output.defaults-not-ie-11.css | CSS | .class {
-webkit-text-emphasis: none;
text-emphasis: none;
}
.class {
text-emphasis: filled red;
-webkit-text-emphasis: filled red;
}
.class {
-webkit-text-emphasis-position: left;
text-emphasis-position: left;
}
.class {
-webkit-text-emphasis-style: circle;
text-emphasis-style: circle;
}
.class {
-we... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-orientation/input.css | CSS | .class {
writing-mode: vertical-rl;
text-orientation: mixed;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-orientation/output.css | CSS | .class {
-webkit-writing-mode: vertical-rl;
-ms-writing-mode: tb-rl;
writing-mode: vertical-rl;
-webkit-text-orientation: mixed;
text-orientation: mixed;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-orientation/output.defaults-not-ie-11.css | CSS | .class {
writing-mode: vertical-rl;
text-orientation: mixed;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-overflow/input.css | CSS | .class {
text-overflow: clip;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-overflow/output.css | CSS | .class {
-o-text-overflow: clip;
text-overflow: clip;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-overflow/output.defaults-not-ie-11.css | CSS | .class {
text-overflow: clip;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-size-adjust/input.css | CSS | .class {
text-align: left;
text-transform: none;
text-shadow: none;
text-size-adjust: none;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-size-adjust/output.css | CSS | .class {
text-align: left;
text-transform: none;
text-shadow: none;
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
-ms-text-size-adjust: none;
text-size-adjust: none;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-size-adjust/output.defaults-not-ie-11.css | CSS | .class {
text-align: left;
text-transform: none;
text-shadow: none;
-webkit-text-size-adjust: none;
text-size-adjust: none;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-spacing/input.css | CSS | .class {
text-spacing: none;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-spacing/output.css | CSS | .class {
-ms-text-spacing: none;
text-spacing: none;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/text-spacing/output.defaults-not-ie-11.css | CSS | .class {
text-spacing: none;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/touch-action/input.css | CSS | .class {
touch-action: none;
}
.class {
touch-action: manipulation;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/touch-action/output.css | CSS | .class {
-ms-touch-action: -ms-none;
-ms-touch-action: none;
touch-action: none;
}
.class {
-ms-touch-action: -ms-manipulation;
-ms-touch-action: manipulation;
touch-action: manipulation;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/touch-action/output.defaults-not-ie-11.css | CSS | .class {
touch-action: none;
}
.class {
touch-action: manipulation;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/transform/input.css | CSS | .class {
transform: rotate(30deg);
}
a {
transition: transform 1s;
transform: rotateX(45deg);
}
b {
transform: translateX(45deg);
transform-origin: 0 0;
}
em {
transform: rotateZ(45deg);
}
@keyframes anim {
from {
transform: rotate(90deg);
}
}
.class {
transform-style: flat... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/transform/output.css | CSS | .class {
-webkit-transform: rotate(30deg);
-moz-transform: rotate(30deg);
-ms-transform: rotate(30deg);
-o-transform: rotate(30deg);
transform: rotate(30deg);
}
a {
-webkit-transition: -webkit-transform 1s;
-moz-transition: -moz-transform 1s;
-o-transition: -o-transform 1s;
transition: -webkit-transfo... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/transform/output.defaults-not-ie-11.css | CSS | .class {
transform: rotate(30deg);
}
a {
transition: transform 1s;
transform: rotateX(45deg);
}
b {
transform: translateX(45deg);
transform-origin: 0 0;
}
em {
transform: rotateZ(45deg);
}
@keyframes anim {
from {
transform: rotate(90deg);
}
}
.class {
transform-style: flat;
}
.class {
transform... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/transition/input.css | CSS | a {
transition: color 200ms, transform 200ms;
transform: rotate(10deg);
}
div {
transition-property: filter;
animation-name: rotating;
}
.good {
transition-property: filter;
transition-duration: 1s;
}
.good2 {
transition-property: color, filter;
transition-timing-function: cubic-bezie... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/transition/output.css | CSS | a {
-webkit-transition: color 200ms, -webkit-transform 200ms;
-moz-transition: color 200ms, -moz-transform 200ms;
-o-transition: color 200ms, -o-transform 200ms;
transition: color 200ms, -webkit-transform 200ms;
transition: color 200ms, -moz-transform 200ms;
transition: color 200ms, -o-transform 200ms;
tr... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/transition/output.defaults-not-ie-11.css | CSS | a {
transition: color 200ms, transform 200ms;
transform: rotate(10deg);
}
div {
transition-property: filter;
animation-name: rotating;
}
.good {
transition-property: filter;
transition-duration: 1s;
}
.good2 {
transition-property: color, filter;
transition-timing-function: cubic-bezier(0.55, 0, 0.1, 1);... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/user-select/input.css | CSS | a {
user-select: none;
}
b {
user-select: contain;
}
.all {
user-select: all;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/user-select/output.css | CSS | a {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
b {
-webkit-user-select: contain;
-moz-user-select: contain;
-ms-user-select: element;
user-select: contain;
}
.all {
-webkit-user-select: all;
-moz-user-select: all;
user-select: all;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/user-select/output.defaults-not-ie-11.css | CSS | a {
-webkit-user-select: none;
user-select: none;
}
b {
-webkit-user-select: contain;
user-select: contain;
}
.all {
-webkit-user-select: all;
user-select: all;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/viewport/input.css | CSS | @viewport {
min-width: 640px;
max-width: 800px;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/viewport/output.css | CSS | @-ms-viewport{
min-width: 640px;
max-width: 800px;
}
@-o-viewport{
min-width: 640px;
max-width: 800px;
}
@viewport{
min-width: 640px;
max-width: 800px;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/viewport/output.defaults-not-ie-11.css | CSS | @viewport{
min-width: 640px;
max-width: 800px;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/width-size/input.css | CSS | div {
width: fit-content;
width: max-content;
width: min-content;
width: fill-available;
width: stretch;
min-width: fit-content;
max-width: fit-content;
height: fit-content;
min-height: fit-content;
max-height: fit-content;
inline-size: fit-content;
min-inline-size: fit-... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/width-size/output.css | CSS | div {
width: -webkit-fit-content;
width: -moz-fit-content;
width: fit-content;
width: -webkit-max-content;
width: -moz-max-content;
width: max-content;
width: -webkit-min-content;
width: -moz-min-content;
width: min-content;
width: -webkit-fill-available;
width: -moz-available;
width: fill-avail... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/width-size/output.defaults-not-ie-11.css | CSS | div {
width: fit-content;
width: max-content;
width: min-content;
width: -webkit-fill-available;
width: -moz-available;
width: fill-available;
width: -webkit-fill-available;
width: -moz-available;
width: stretch;
min-width: fit-content;
max-width: fit-content;
height: fit-content;
min-height: ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/width/input.css | CSS | .class {
width: auto;
}
.class {
width: unset;
}
.class {
width: initial;
}
.class {
width: inherit;
}
.class {
width: 10;
}
.class {
width: min();
}
.class {
width: var(--foo-content);
}
.class {
width: var(-content);
}
.class {
width: var(--max-content);
}
.class {
wid... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/width/output.css | CSS | .class {
width: auto;
}
.class {
width: unset;
}
.class {
width: initial;
}
.class {
width: inherit;
}
.class {
width: 10;
}
.class {
width: min();
}
.class {
width: var(--foo-content);
}
.class {
width: var(-content);
}
.class {
width: var(--max-content);
}
.class {
width: --max-content;
}
.class {... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/width/output.defaults-not-ie-11.css | CSS | .class {
width: auto;
}
.class {
width: unset;
}
.class {
width: initial;
}
.class {
width: inherit;
}
.class {
width: 10;
}
.class {
width: min();
}
.class {
width: var(--foo-content);
}
.class {
width: var(-content);
}
.class {
width: var(--max-content);
}
.class {
width: --max-content;
}
.class {... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/writing-mode/input.css | CSS | .one {
writing-mode: horizontal-tb;
}
.two {
writing-mode: vertical-rl;
}
.three {
writing-mode: vertical-lr;
}
.rtl-vertical-rl {
writing-mode: vertical-rl;
direction: rtl;
}
.rtl-vertical-lr {
writing-mode: vertical-lr;
direction: rtl;
}
.rtl-horizontal-tb {
writing-mode: horizont... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/writing-mode/output.css | CSS | .one {
-webkit-writing-mode: horizontal-tb;
-ms-writing-mode: lr-tb;
writing-mode: horizontal-tb;
}
.two {
-webkit-writing-mode: vertical-rl;
-ms-writing-mode: tb-rl;
writing-mode: vertical-rl;
}
.three {
-webkit-writing-mode: vertical-lr;
-ms-writing-mode: tb-lr;
writing-mode: vertical-lr;
}
.rtl-ver... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/fixture/writing-mode/output.defaults-not-ie-11.css | CSS | .one {
writing-mode: horizontal-tb;
}
.two {
writing-mode: vertical-rl;
}
.three {
writing-mode: vertical-lr;
}
.rtl-vertical-rl {
writing-mode: vertical-rl;
direction: rtl;
}
.rtl-vertical-lr {
writing-mode: vertical-lr;
direction: rtl;
}
.rtl-horizontal-tb {
writing-mode: horizontal-tb;
direction: r... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_prefixer/tests/prefixer.rs | Rust | //! Tests ported from https://github.com/thysultan/stylis.js
//!
//! License is MIT, which is original license at the time of copying.
//! Original test authors have copyright for their work.
#![deny(warnings)]
#![allow(clippy::needless_update)]
use std::path::PathBuf;
use preset_env_base::query::{Query, Targets};
us... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_utils/src/lib.rs | Rust | #![deny(clippy::all)]
use std::{borrow::Cow, f64::consts::PI, str};
use once_cell::sync::Lazy;
use rustc_hash::FxHashMap;
use serde::{Deserialize, Serialize};
use swc_atoms::{Atom, StaticString};
use swc_css_ast::*;
use swc_css_visit::{VisitMut, VisitMutWith};
pub struct IdentReplacer<'a> {
from: &'a str,
to... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_css_visit/src/lib.rs | Rust | #![cfg_attr(docsrs, feature(doc_cfg))]
#![deny(clippy::all)]
#![allow(clippy::ptr_arg)]
pub use crate::generated::*;
mod generated;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/class.rs | Rust | use is_macro::Is;
use swc_common::{ast_node, util::take::Take, EqIgnoreSpan, Span, SyntaxContext, DUMMY_SP};
use crate::{
expr::Expr,
function::{Function, ParamOrTsParamProp},
ident::PrivateName,
prop::PropName,
stmt::BlockStmt,
typescript::{
Accessibility, TsExprWithTypeArgs, TsIndexSi... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/decl.rs | Rust | use is_macro::Is;
use string_enum::StringEnum;
use swc_common::{ast_node, util::take::Take, EqIgnoreSpan, Span, SyntaxContext, DUMMY_SP};
use crate::{
class::Class,
expr::Expr,
function::Function,
ident::Ident,
pat::Pat,
typescript::{TsEnumDecl, TsInterfaceDecl, TsModuleDecl, TsTypeAliasDecl},
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/expr.rs | Rust | #![allow(clippy::vec_box)]
use std::{borrow::Cow, mem::transmute};
use is_macro::Is;
use string_enum::StringEnum;
use swc_atoms::Atom;
use swc_common::{
ast_node, util::take::Take, BytePos, EqIgnoreSpan, Span, Spanned, SyntaxContext, DUMMY_SP,
};
use crate::{
class::Class,
function::Function,
ident::{... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/function.rs | Rust | use is_macro::Is;
use swc_common::{ast_node, util::take::Take, EqIgnoreSpan, Span, SyntaxContext, DUMMY_SP};
use crate::{
class::Decorator,
pat::Pat,
stmt::BlockStmt,
typescript::{TsParamProp, TsTypeAnn, TsTypeParamDecl},
};
/// Common parts of function and method.
#[ast_node]
#[derive(Eq, Hash, EqIgn... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/ident.rs | Rust | use std::{
borrow::Cow,
fmt::Display,
ops::{Deref, DerefMut},
};
use phf::phf_set;
use swc_atoms::{atom, Atom, UnsafeAtom};
use swc_common::{
ast_node, util::take::Take, BytePos, EqIgnoreSpan, Mark, Span, Spanned, SyntaxContext, DUMMY_SP,
};
use crate::{typescript::TsTypeAnn, Expr};
/// Identifier us... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/jsx.rs | Rust | use is_macro::Is;
use swc_atoms::Atom;
use swc_common::{ast_node, util::take::Take, EqIgnoreSpan, Span, DUMMY_SP};
use crate::{
expr::{Expr, SpreadElement},
ident::Ident,
lit::Lit,
typescript::TsTypeParamInstantiation,
IdentName,
};
/// Used for `obj` property of `JSXMemberExpr`.
#[ast_node]
#[der... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/lib.rs | Rust | #![cfg_attr(docsrs, feature(doc_cfg))]
#![deny(unreachable_patterns)]
#![deny(missing_copy_implementations)]
#![deny(trivial_casts)]
#![deny(trivial_numeric_casts)]
#![deny(unreachable_pub)]
#![deny(clippy::all)]
#![allow(clippy::enum_variant_names)]
#![allow(clippy::clone_on_copy)]
#![recursion_limit = "1024"]
pub us... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/list.rs | Rust | #![allow(unused)]
#![allow(non_upper_case_globals)]
use bitflags::bitflags;
bitflags! {
/// Represents the formatting rule for a list of nodes.
#[derive(PartialEq, Eq, Copy, Clone)]
pub struct ListFormat: u32 {
/// Default value.
const None = 0;
// Line separators
/// Print... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/lit.rs | Rust | use std::{
borrow::Cow,
fmt::{self, Display, Formatter},
hash::{Hash, Hasher},
};
use is_macro::Is;
use num_bigint::BigInt as BigIntValue;
use swc_atoms::{atom, Atom};
use swc_common::{ast_node, util::take::Take, EqIgnoreSpan, Span, DUMMY_SP};
use crate::jsx::JSXText;
#[ast_node]
#[derive(Eq, Hash, EqIgn... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/macros.rs | Rust | /// Creates a corresponding operator. This macro is used to make code more
/// readable.
///
/// This can used to represent [UnaryOp](crate::UnaryOp),
/// [BinaryOp](crate::BinaryOp), or [AssignOp](crate::AssignOp).
///
/// Actual type is determined by the input.
///
/// # Note about `+` and `-`
///
/// As this macro i... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/module.rs | Rust | use is_macro::Is;
use swc_atoms::Atom;
use swc_common::{ast_node, util::take::Take, EqIgnoreSpan, Span, DUMMY_SP};
use crate::{module_decl::ModuleDecl, stmt::Stmt};
#[ast_node]
#[derive(Eq, Hash, Is, EqIgnoreSpan)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[cfg_attr(feature = "shrink-to-fit", ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/module_decl.rs | Rust | use is_macro::Is;
use swc_atoms::Atom;
use swc_common::{ast_node, util::take::Take, EqIgnoreSpan, Span, DUMMY_SP};
use crate::{
decl::Decl,
expr::{ClassExpr, Expr, FnExpr},
ident::Ident,
lit::Str,
typescript::{TsExportAssignment, TsImportEqualsDecl, TsInterfaceDecl, TsNamespaceExportDecl},
Bind... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/operators.rs | Rust | use string_enum::StringEnum;
use swc_common::EqIgnoreSpan;
#[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, EqIgnoreSpan, Default)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[cfg_attr(feature = "shrink-to-fit", derive(shrink_to_fit::ShrinkToFit))]
#[cfg_attr(
any(feat... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/pat.rs | Rust | use is_macro::Is;
use swc_common::{ast_node, util::take::Take, EqIgnoreSpan, Span, DUMMY_SP};
use crate::{
expr::Expr,
ident::{BindingIdent, Ident},
prop::PropName,
typescript::TsTypeAnn,
Id, IdentName, Invalid,
};
#[ast_node(no_clone)]
#[derive(Eq, Hash, Is, EqIgnoreSpan)]
#[cfg_attr(feature = "a... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/prop.rs | Rust | use is_macro::Is;
use swc_common::{ast_node, util::take::Take, EqIgnoreSpan, Span, DUMMY_SP};
use crate::{
expr::Expr,
function::Function,
ident::Ident,
lit::{BigInt, Number, Str},
stmt::BlockStmt,
typescript::TsTypeAnn,
Id, IdentName, MemberProp, Pat,
};
#[ast_node]
#[derive(Eq, Hash, Is,... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/source_map.rs | Rust | use std::{rc::Rc, sync::Arc};
use swc_common::{BytePos, SourceMap, SourceMapper, SourceMapperDyn, Span, Spanned};
use crate::list::ListFormat;
pub trait SpanExt: Spanned {
#[inline]
fn is_synthesized(&self) -> bool {
false
}
fn starts_on_new_line(&self, format: ListFormat) -> bool {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/stmt.rs | Rust | use is_macro::Is;
use swc_common::{ast_node, util::take::Take, EqIgnoreSpan, Span, SyntaxContext, DUMMY_SP};
use crate::{
decl::{Decl, VarDecl},
expr::Expr,
pat::Pat,
Ident, Lit, Str, UsingDecl,
};
/// Use when only block statements are allowed.
#[ast_node("BlockStatement")]
#[derive(Eq, Hash, EqIgnor... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_ast/src/typescript.rs | Rust | #![allow(clippy::vec_box)]
#![allow(missing_copy_implementations)]
#[cfg(feature = "serde-impl")]
use std::fmt;
use is_macro::Is;
#[cfg(feature = "serde-impl")]
use serde::{
de::{self, Unexpected, Visitor},
Deserialize, Deserializer, Serialize,
};
use string_enum::StringEnum;
use swc_atoms::Atom;
use swc_comm... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/benches/bench.rs | Rust | extern crate swc_malloc;
use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Bencher, Criterion};
use swc_common::FileName;
use swc_ecma_codegen::Emitter;
use swc_ecma_parser::{Parser, StringInput, Syntax};
const COLORS_JS: &str = r#"
'use strict';
/**
* Extract red color out of a color integ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/benches/large-partial.js | JavaScript | /**
* @license Angular v6.1.10
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
var r=function(){return function(){}}(),i=function(){return function(){}}(),o="*";function a(e,t){return{type:7,name:e,definitions:t,options:{}}}function s(e,t){return void 0===t&&(t=null),{type... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/benches/with_parse.rs | Rust | extern crate swc_malloc;
use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Bencher, Criterion};
use swc_common::FileName;
use swc_ecma_codegen::Emitter;
use swc_ecma_parser::{Parser, StringInput, Syntax};
const COLORS_JS: &str = r#"
'use strict';
/**
* Extract red color out of a color integ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/examples/gen.rs | Rust | /// Use memory allocator
extern crate swc_malloc;
use std::{env, fs, path::Path, time::Instant};
use swc_common::input::SourceFileInput;
use swc_ecma_ast::*;
use swc_ecma_codegen::{text_writer::JsWriter, Emitter};
use swc_ecma_parser::{lexer::Lexer, Parser, Syntax};
fn parse_and_gen(entry: &Path) {
testing::run_... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/examples/sourcemap.rs | Rust | /// Use memory allocator
extern crate swc_malloc;
use std::{
env,
fs::{self, File},
io::BufWriter,
path::Path,
time::Instant,
};
use swc_common::input::SourceFileInput;
use swc_ecma_ast::*;
use swc_ecma_codegen::{text_writer::JsWriter, Emitter};
use swc_ecma_parser::{lexer::Lexer, Parser, Syntax};... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/scripts/bench.sh | Shell | #!/usr/bin/env bash
set -eux
rm -rf ../../target/release/bench-*
cargo bench --no-run --bench with_parse
# TODO:
#sudo flamegraph -- "../../target/release/bench-* --bench" | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/scripts/compare-file.sh | Shell | #!/usr/bin/env bash
set -eu
echo ''
echo ''
echo ''
echo "Comparing $1"
EXPECTED=$(terser "$1" | xargs)
ACTUAL=$(cat "$1" | xargs)
if [[ $EXPECTED == $ACTUAL || $EXPECTED == "$ACTUAL;" ]]; then
echo "PASSED";
git add "$1"
else
echo $EXPECTED
echo $ACTUAL
echo "FAILED"
fi
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/scripts/compare.sh | Shell | #!/usr/bin/env bash
set -eu
git status -u --porcelain \
| grep '?? ecmascript/codegen/tests' \
| sed -e 's!^?? ecmascript/codegen/!!' \
| xargs -L 1 ./scripts/compare-file.sh | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/comments.rs | Rust | use swc_common::comments::Comment;
use super::*;
macro_rules! write_comments {
($e:expr, $prefix_space:expr, $cmts:expr) => {{
let cmts = match $cmts {
Some(v) => v,
None => return Ok(()),
};
for cmt in cmts.iter() {
match cmt.kind {
Com... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/config.rs | Rust | #[cfg(feature = "serde-impl")]
use serde::{Deserialize, Serialize};
use swc_ecma_ast::EsVersion;
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde-impl", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde-impl", serde(rename_all = "camelCase"))]
#[non_exhaustive]
pub struct Config {
/// The targe... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/decl.rs | Rust | use swc_common::{SourceMapper, Spanned};
use swc_ecma_ast::*;
use swc_ecma_codegen_macros::emitter;
use super::{Emitter, Result};
use crate::text_writer::WriteJs;
impl<W, S: SourceMapper> Emitter<'_, W, S>
where
W: WriteJs,
S: SourceMapperExt,
{
#[emitter]
fn emit_decl(&mut self, node: &Decl) -> Resul... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/expr.rs | Rust | /// Copied from [ratel][]
///
/// [ratel]:https://github.com/ratel-rust/ratel-core
#[cfg(test)]
mod tests {
use crate::tests::assert_min;
#[test]
fn values() {
assert_min("null", "null");
assert_min("undefined", "undefined");
assert_min("true", "true");
assert_min("false", "... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/jsx.rs | Rust | use swc_common::{SourceMapper, Spanned};
use swc_ecma_ast::*;
use swc_ecma_codegen_macros::emitter;
use super::{Emitter, Result};
use crate::text_writer::WriteJs;
impl<W, S: SourceMapper> Emitter<'_, W, S>
where
W: WriteJs,
S: SourceMapperExt,
{
#[emitter]
fn emit_jsx_element(&mut self, node: &JSXElem... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/lib.rs | Rust | #![recursion_limit = "1024"]
#![deny(clippy::all)]
#![deny(unused)]
#![allow(clippy::match_like_matches_macro)]
#![allow(clippy::nonminimal_bool)]
#![allow(non_local_definitions)]
use std::{borrow::Cow, fmt::Write, io, ops::Deref, str};
use ascii::AsciiChar;
use compact_str::{format_compact, CompactString};
use memch... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/macros.rs | Rust | #![allow(unused)]
macro_rules! opt_leading_space {
($emitter:expr, $e:expr) => {
if let Some(ref e) = $e {
formatting_space!($emitter);
emit!($emitter, e);
}
};
}
macro_rules! opt {
($emitter:expr, $e:expr) => {{
if let Some(ref expr) = $e {
emit... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/stmt.rs | Rust | /// Copied from [ratel][]
///
/// [ratel]:https://github.com/ratel-rust/ratel-core
#[cfg(test)]
mod tests {
use crate::tests::{assert_min, assert_pretty};
#[test]
fn block_statement() {
assert_min("{}", "{}");
assert_min("{foo;}", "{foo}");
}
#[test]
fn empty_block_statement() ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/tests.rs | Rust | use std::path::PathBuf;
use swc_common::{comments::SingleThreadedComments, FileName, SourceMap};
use swc_ecma_parser;
use swc_ecma_testing::{exec_node_js, JsExecOptions};
use testing::DebugUsingDisplay;
use self::swc_ecma_parser::{EsSyntax, Parser, StringInput, Syntax};
use super::*;
use crate::text_writer::omit_trai... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/text_writer.rs | Rust | pub use self::{basic_impl::JsWriter, semicolon::omit_trailing_semi};
use super::*;
mod basic_impl;
mod semicolon;
/// TODO
pub type Symbol = Str;
/// Ecmascript writer.
///
/// Ported from `EmitWriteJs`.
pub trait WriteJs {
fn increase_indent(&mut self) -> Result;
fn decrease_indent(&mut self) -> Result;
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/text_writer/basic_impl.rs | Rust | use std::io::Write;
use rustc_hash::FxBuildHasher;
use swc_allocator::api::global::HashSet;
use swc_common::{sync::Lrc, BytePos, LineCol, SourceMap, Span};
use super::{Result, WriteJs};
///
/// -----
///
/// Ported from `createTextWriter` of the typescript compiler.
///
/// https://github.com/Microsoft/TypeScript/bl... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/text_writer/semicolon.rs | Rust | use swc_common::{BytePos, Span, DUMMY_SP};
use super::{Result, WriteJs};
pub fn omit_trailing_semi<W: WriteJs>(w: W) -> impl WriteJs {
OmitTrailingSemi {
inner: w,
pending_semi: None,
}
}
#[derive(Debug, Clone)]
struct OmitTrailingSemi<W: WriteJs> {
inner: W,
pending_semi: Option<Span... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/typescript.rs | Rust | use swc_common::{SourceMapper, Spanned};
use swc_ecma_ast::*;
use swc_ecma_codegen_macros::emitter;
use super::{Emitter, Result};
use crate::text_writer::WriteJs;
impl<W, S: SourceMapper + SourceMapperExt> Emitter<'_, W, S>
where
W: WriteJs,
{
#[emitter]
fn emit_pat_or_ts_param_prop(&mut self, n: &ParamOr... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/src/util.rs | Rust | use swc_ecma_ast::*;
pub trait EndsWithAlphaNum {
fn ends_with_alpha_num(&self) -> bool;
}
impl EndsWithAlphaNum for ForHead {
fn ends_with_alpha_num(&self) -> bool {
match self {
ForHead::VarDecl(n) => n.ends_with_alpha_num(),
ForHead::Pat(n) => n.ends_with_alpha_num(),
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/tests/fixture.rs | Rust | use std::path::{Path, PathBuf};
use swc_ecma_ast::EsVersion;
use swc_ecma_codegen::{
text_writer::{JsWriter, WriteJs},
Emitter,
};
use swc_ecma_parser::{parse_file_as_module, Syntax, TsSyntax};
use testing::{run_test2, NormalizedOutput};
fn run(input: &Path, minify: bool) {
let dir = input.parent().unwrap... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/tests/fixture/big-int/input.js | JavaScript | const n1 = 9007199254740991n;
const n2 = -9007199254740991n;
const n3 = +9007199254740991n;
const n4 = 100_000_000n;
const n5 = 0n;
const n6 = +0n;
const n7 = -0n;
const n8 = 0x10n;
const n9 = 0X10n;
const n10 = 0X10n;
const n11 = 0b101n;
const n12 = 0b101n;
const n13 = 0o13n;
const n14 = 0b101_101n;
const n15 = 100000... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/tests/fixture/big-int/output.js | JavaScript | const n1 = 9007199254740991n;
const n2 = -9007199254740991n;
const n3 = +9007199254740991n;
const n4 = 100_000_000n;
const n5 = 0n;
const n6 = +0n;
const n7 = -0n;
const n8 = 0x10n;
const n9 = 0X10n;
const n10 = 0X10n;
const n11 = 0b101n;
const n12 = 0b101n;
const n13 = 0o13n;
const n14 = 0b101_101n;
const n15 = 100000... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/tests/fixture/big-int/output.min.js | JavaScript | const n1=9007199254740991n;const n2=-9007199254740991n;const n3=+9007199254740991n;const n4=100000000n;const n5=0n;const n6=+0n;const n7=-0n;const n8=16n;const n9=16n;const n10=16n;const n11=5n;const n12=5n;const n13=11n;const n14=45n;const n15=0x2386f26fc10000n;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/tests/fixture/issue-5912/input.js | JavaScript | function te(a) { var b, c, d, e, f; if (isNaN(a)) { return Qe(), Pe } if (a < -9223372036854775808) { return Qe(), Ne } if (a >= 9223372036854775807) { return Qe(), Me } e = false; if (a < 0) { e = true; a = -a } d = 0; if (a >= 17592186044416) { d = Bc(a / 17592186044416); a -= d * 17592186044416 } c = 0; if (a >= 419... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/tests/fixture/issue-5912/output.js | JavaScript | function te(a) {
var b, c, d, e, f;
if (isNaN(a)) {
return Qe(), Pe;
}
if (a < -9223372036854775808) {
return Qe(), Ne;
}
if (a >= 9223372036854775807) {
return Qe(), Me;
}
e = false;
if (a < 0) {
e = true;
a = -a;
}
d = 0;
if (a >=... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/tests/fixture/issue-5912/output.min.js | JavaScript | function te(a){var b,c,d,e,f;if(isNaN(a)){return Qe(),Pe}if(a<-0x8000000000000000){return Qe(),Ne}if(a>=0x8000000000000000){return Qe(),Me}e=false;if(a<0){e=true;a=-a}d=0;if(a>=0x100000000000){d=Bc(a/0x100000000000);a-=d*0x100000000000}c=0;if(a>=4194304){c=Bc(a/4194304);a-=c*4194304}b=Bc(a);f=de(b,c,d);e&&je(f);return ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/tests/fixture/issue-6589/js/input.js | JavaScript | export function func({a, b, ...rest}) {
console.log(a,b, rest)
}
const other = { unknow: "foo" }
let foo = {
...other,
bar: "baz"
};
let bar = {
bar: "baz",
...other
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/tests/fixture/issue-6589/js/output.js | JavaScript | export function func({ a, b, ...rest }) {
console.log(a, b, rest);
}
const other = {
unknow: "foo"
};
let foo = {
...other,
bar: "baz"
};
let bar = {
bar: "baz",
...other
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_codegen/tests/fixture/issue-6589/js/output.min.js | JavaScript | export function func({a,b,...rest}){console.log(a,b,rest)}const other={unknow:"foo"};let foo={...other,bar:"baz"};let bar={bar:"baz",...other};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.