Skip to content

Commit

Permalink
feat(readme):add badges
Browse files Browse the repository at this point in the history
  • Loading branch information
limuy2022 committed Apr 13, 2024
1 parent 17342af commit 06bac51
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Trc programming language

Trc is a easy-learn programming language.It can be fast,safe and effective.
Trc is a easy-learn programming language. It can be fast,safe and effective.

|Platform|Status|
|:---|:---|
|Linux|![Linux Test](https://img.shields.io/github/actions/workflow/status/limuy2022/trc/rust_linux.yml)|
|Winodows|![Windows Test](https://img.shields.io/github/actions/workflow/status/limuy2022/trc/rust_windows.yml)|
|Macos|![Macos Test](https://img.shields.io/github/actions/workflow/status/limuy2022/trc/rust_macos.yml)|

![Total Lines](https://tokei.rs/b1/github/limuy2022/trc)

## Goal

Expand Down
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ The next is the string value. To make you to write strings more easily:
There are also many easape char in the string:

| escape char | meaning |
| :---------- | :-------------------------------- | --- |
| :---------- | :-------------------------------- |
| \t | tab |
| \n | new line |
| \\\\ | \| | |
| \\\\ | \| |
| \' | ' |
| \" | " |
| \0 | the tick of the end of the string |
Expand Down
1 change: 1 addition & 0 deletions src/compiler.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pub mod ast;
pub mod linker;
pub mod llvm_convent;
pub mod manager;
pub mod scope;
pub mod token;

Expand Down
28 changes: 28 additions & 0 deletions src/compiler/manager.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
use std::collections::HashMap;

use crate::compiler::ast::AstBuilder;

/// ast的控制者,总管一个编译过程中的数据
/// ast manager
pub struct AstManager<'a> {
// 储存模块和对应的中间文件的关系
modules: HashMap<String, String>,
// 有的模块是本次已经编译过的,在缓存中可以直接找到
cache: HashMap<String, AstBuilder<'a>>,
}

impl<'a> AstManager<'a> {
pub fn new() -> Self {
Self {
modules: HashMap::new(),
cache: HashMap::new(),
}
}
}

impl<'a> Default for AstManager<'a> {
fn default() -> Self {
Self::new()
}
}

0 comments on commit 06bac51

Please sign in to comment.