mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
fromCodePoint
This commit is contained in:
@@ -329,6 +329,7 @@ impl Assembler {
|
||||
let builtin_code = match builtin.name.as_str() {
|
||||
"Math" => 0,
|
||||
"Debug" => 1,
|
||||
"String" => 2,
|
||||
_ => panic!("Unknown builtin: {}", builtin.name),
|
||||
};
|
||||
|
||||
|
||||
@@ -747,13 +747,16 @@ impl<'a> AssemblyParser<'a> {
|
||||
}
|
||||
|
||||
fn assemble_builtin(&mut self) -> Builtin {
|
||||
match self.parse_one_of(&["$Math", "$Debug"]).as_str() {
|
||||
match self.parse_one_of(&["$Math", "$Debug", "$String"]).as_str() {
|
||||
"$Math" => Builtin {
|
||||
name: "Math".to_string(),
|
||||
},
|
||||
"$Debug" => Builtin {
|
||||
name: "Debug".to_string(),
|
||||
},
|
||||
"$String" => Builtin {
|
||||
name: "String".to_string(),
|
||||
},
|
||||
_ => panic!("Shouldn't happen"),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,6 +95,12 @@ pub fn init_std_scope() -> Scope {
|
||||
name: "Debug".to_string(),
|
||||
}),
|
||||
),
|
||||
(
|
||||
"String".to_string(),
|
||||
MappedName::Builtin(Builtin {
|
||||
name: "String".to_string(),
|
||||
}),
|
||||
),
|
||||
]),
|
||||
parent: None,
|
||||
})),
|
||||
|
||||
@@ -57,7 +57,7 @@ impl ScopeAnalysis {
|
||||
let mut sa = ScopeAnalysis::default();
|
||||
let scope = init_std_scope();
|
||||
|
||||
for builtin_name in vec!["Debug", "Math"] {
|
||||
for builtin_name in vec!["Debug", "Math", "String"] {
|
||||
let builtin = Builtin {
|
||||
name: builtin_name.to_string(),
|
||||
};
|
||||
@@ -1629,6 +1629,12 @@ fn init_std_scope() -> XScope {
|
||||
name: "Debug".to_string(),
|
||||
}),
|
||||
),
|
||||
(
|
||||
swc_atoms::JsWord::from("String"),
|
||||
NameId::Builtin(Builtin {
|
||||
name: "String".to_string(),
|
||||
}),
|
||||
),
|
||||
]),
|
||||
parent: None,
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user