Skip to content

Commit

Permalink
Add and parse hanzi2roman-map-pinyin
Browse files Browse the repository at this point in the history
  • Loading branch information
sozysozbot committed Jul 19, 2020
1 parent 648b761 commit cb6f4f2
Show file tree
Hide file tree
Showing 5 changed files with 25,524 additions and 8 deletions.
30 changes: 30 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ edition = "2018"

[dependencies]
peek-nth = "0.2.0"
clap = "2.33.1"
clap = "2.33.1"
serde_json = "1.0.56"
12 changes: 6 additions & 6 deletions src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ fn compile_statement(env: &mut Env, st: &parse::Statement) -> String {
anon_counter: env.anon_counter,

/// shu1zhi1_reference must be inherited, since in the original compiler
///
///
/// ```
/// 吾有二言。曰「「天地。」」。
/// 為是三遍。
/// 書之。
/// 吾有一言。曰「「問天地好在。」」。書之。
/// 云云。
/// ```
///
/// is translated into
///
///
/// is translated into
///
/// ```
/// var _ans1 = "天地。";
/// var _ans2 = "";
Expand All @@ -105,8 +105,8 @@ fn compile_statement(env: &mut Env, st: &parse::Statement) -> String {

ans
}

pub fn compile(parsed: &Vec<parse::Statement>) -> String {
use std::collections::HashMap;
pub fn compile(parsed: &Vec<parse::Statement>, conversion_table: &HashMap<String, String>) -> String {
let mut ans = "fn main() {\n".to_string();
let mut env = Env {
anon_counter: 0,
Expand Down
Loading

0 comments on commit cb6f4f2

Please sign in to comment.