Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Improve trait naming
Browse files Browse the repository at this point in the history
  • Loading branch information
alxkzmn committed Aug 27, 2024
1 parent de1e458 commit 04e6cbf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/parser/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,14 @@ impl PartialEq for DebugSymRef {
}

/// Interface of the debug symbol reference to use with the Chiquito language server
pub trait LanguageServerInterface {
pub trait Spanned {
/// Get span start
fn get_start(&self) -> usize;
/// Get span end
fn get_end(&self) -> usize;
}

impl LanguageServerInterface for DebugSymRef {
impl Spanned for DebugSymRef {
fn get_start(&self) -> usize {
self.start
}
Expand Down Expand Up @@ -243,7 +245,7 @@ mod test {

use codespan_reporting::files::SimpleFile;

use crate::parser::ast::{DebugSymRef, Identifier, LanguageServerInterface};
use crate::parser::ast::{DebugSymRef, Identifier, Spanned};

#[test]
fn test_language_server_interface() {
Expand Down

0 comments on commit 04e6cbf

Please sign in to comment.