Skip to content

Commit

Permalink
refactor: 💡 refactor tiny lang (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
IWANABETHATGUY authored Nov 18, 2024
1 parent 9dae19c commit 4e7834f
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 141 deletions.
2 changes: 1 addition & 1 deletion examples/index.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Ok;
use nrs_language_server::{
chumsky::{parse, ParserResult},
nrs_lang::{parse, ParserResult},
semantic_analyze,
};

Expand Down
2 changes: 1 addition & 1 deletion src/completion.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;

use crate::chumsky::{Expr, Func, Spanned};
use crate::nrs_lang::{Expr, Func, Spanned};
pub enum ImCompleteCompletionItem {
Variable(String),
Function(String, Vec<String>),
Expand Down
129 changes: 0 additions & 129 deletions src/jump_definition.rs

This file was deleted.

2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub mod chumsky;
pub mod completion;
pub mod nrs_lang;
pub mod semantic_analyze;
pub mod semantic_token;
pub mod span;
Expand Down
12 changes: 6 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use std::collections::HashMap;

use dashmap::DashMap;
use log::debug;
use nrs_language_server::chumsky::{
use nrs_language_server::completion::completion;
use nrs_language_server::nrs_lang::{
parse, type_inference, Ast, ImCompleteSemanticToken, ParserResult,
};
use nrs_language_server::completion::completion;
use nrs_language_server::semantic_analyze::{analyze_program, IdentType, Semantic};
use nrs_language_server::semantic_token::LEGEND_TYPE;
use nrs_language_server::span::Span;
Expand Down Expand Up @@ -315,10 +315,10 @@ impl LanguageServer for Backend {
k.start,
k.end,
match v {
nrs_language_server::chumsky::Value::Null => "null".to_string(),
nrs_language_server::chumsky::Value::Bool(_) => "bool".to_string(),
nrs_language_server::chumsky::Value::Num(_) => "number".to_string(),
nrs_language_server::chumsky::Value::Str(_) => "string".to_string(),
nrs_language_server::nrs_lang::Value::Null => "null".to_string(),
nrs_language_server::nrs_lang::Value::Bool(_) => "bool".to_string(),
nrs_language_server::nrs_lang::Value::Num(_) => "number".to_string(),
nrs_language_server::nrs_lang::Value::Str(_) => "string".to_string(),
},
)
})
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/semantic_analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use rust_lapper::{Interval, Lapper};
use std::fmt::Display;

use crate::{
chumsky::{Ast, Expr, Func},
nrs_lang::{Ast, Expr, Func},
span::Span,
symbol_table::{ReferenceId, SymbolId, SymbolTable},
};
Expand Down
4 changes: 2 additions & 2 deletions src/semantic_token.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::collections::HashMap;

use tower_lsp::lsp_types::{SemanticTokenType};
use tower_lsp::lsp_types::SemanticTokenType;

use crate::chumsky::{Expr, Func, ImCompleteSemanticToken, Spanned};
use crate::nrs_lang::{Expr, Func, ImCompleteSemanticToken, Spanned};

pub const LEGEND_TYPE: &[SemanticTokenType] = &[
SemanticTokenType::FUNCTION,
Expand Down

0 comments on commit 4e7834f

Please sign in to comment.