mirror of
https://github.com/swc-project/swc.git
synced 2024-09-19 20:57:35 +03:00
implement more traits for Syntax
This commit is contained in:
parent
b437488082
commit
f89a227d5e
@ -16,6 +16,7 @@ enum_kind = { version = "0.1", path ="../../macros/enum_kind" }
|
||||
unicode-xid = "0.1"
|
||||
log = { version = "0.4", features = ["release_max_level_debug"] }
|
||||
either = { version = "1.4" }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
smallvec = "0.6.7"
|
||||
lazy_static = "1"
|
||||
regex = "1"
|
||||
|
@ -81,6 +81,7 @@ extern crate log;
|
||||
extern crate swc_atoms;
|
||||
extern crate enum_kind;
|
||||
extern crate regex;
|
||||
extern crate serde;
|
||||
extern crate swc_common;
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
@ -97,6 +98,7 @@ pub use self::{
|
||||
lexer::input::{Input, SourceFileInput},
|
||||
parser::*,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use swc_common::errors::Handler;
|
||||
|
||||
#[macro_use]
|
||||
@ -106,13 +108,20 @@ mod lexer;
|
||||
mod parser;
|
||||
mod token;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)]
|
||||
pub enum Syntax {
|
||||
Es2019,
|
||||
Jsx,
|
||||
Typescript,
|
||||
Tsx,
|
||||
}
|
||||
|
||||
impl Default for Syntax{
|
||||
fn default()->Self{
|
||||
Syntax::Es2019
|
||||
}
|
||||
}
|
||||
|
||||
impl Syntax {
|
||||
/// Should we pare jsx?
|
||||
pub fn jsx(self) -> bool {
|
||||
|
Loading…
Reference in New Issue
Block a user