mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 00:01:15 -03:00
Remove some dead bridge code
This was obviated after the AST was ported to Rust.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
use crate::ffi::{fish_wcswidth, fish_wcwidth, wcharz_t};
|
||||
use crate::tokenizer::variable_assignment_equals_pos;
|
||||
use crate::wchar::prelude::*;
|
||||
use crate::wchar_ffi::{wcharz, AsWstr, WCharFromFFI, WCharToFFI};
|
||||
use crate::wchar_ffi::{AsWstr, WCharFromFFI, WCharToFFI};
|
||||
use bitflags::bitflags;
|
||||
use cxx::{type_id, ExternType};
|
||||
use cxx::{CxxWString, UniquePtr};
|
||||
@@ -61,8 +61,6 @@ pub struct SourceRange {
|
||||
fn contains_inclusive_ffi(self: &SourceRange, loc: u32) -> bool;
|
||||
}
|
||||
|
||||
/// IMPORTANT: If the following enum table is modified you must also update token_type_description below.
|
||||
/// TODO above comment can be removed when we drop the FFI and get real enums.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum ParseTokenType {
|
||||
invalid = 1,
|
||||
@@ -109,12 +107,6 @@ pub enum ParseKeyword {
|
||||
kw_while,
|
||||
}
|
||||
|
||||
extern "Rust" {
|
||||
fn token_type_description(token_type: ParseTokenType) -> wcharz_t;
|
||||
fn keyword_description(keyword: ParseKeyword) -> wcharz_t;
|
||||
fn keyword_from_string(s: wcharz_t) -> ParseKeyword;
|
||||
}
|
||||
|
||||
// Statement decorations like 'command' or 'exec'.
|
||||
pub enum StatementDecoration {
|
||||
none,
|
||||
@@ -196,14 +188,6 @@ fn describe_with_prefix(
|
||||
fn clear(self: &mut ParseErrorListFfi);
|
||||
}
|
||||
|
||||
extern "Rust" {
|
||||
#[cxx_name = "token_type_user_presentable_description"]
|
||||
fn token_type_user_presentable_description_ffi(
|
||||
type_: ParseTokenType,
|
||||
keyword: ParseKeyword,
|
||||
) -> UniquePtr<CxxWString>;
|
||||
}
|
||||
|
||||
// The location of a pipeline.
|
||||
pub enum PipelinePosition {
|
||||
none, // not part of a pipeline
|
||||
@@ -289,11 +273,6 @@ fn from(token_type: ParseTokenType) -> Self {
|
||||
}
|
||||
}
|
||||
|
||||
fn token_type_description(token_type: ParseTokenType) -> wcharz_t {
|
||||
let s: &'static wstr = token_type.into();
|
||||
wcharz!(s)
|
||||
}
|
||||
|
||||
impl Default for ParseKeyword {
|
||||
fn default() -> Self {
|
||||
ParseKeyword::none
|
||||
@@ -333,11 +312,6 @@ fn to_arg(self) -> printf_compat::args::Arg<'static> {
|
||||
}
|
||||
}
|
||||
|
||||
fn keyword_description(keyword: ParseKeyword) -> wcharz_t {
|
||||
let s: &'static wstr = keyword.into();
|
||||
wcharz!(s)
|
||||
}
|
||||
|
||||
impl From<&wstr> for ParseKeyword {
|
||||
#[widestrs]
|
||||
fn from(s: &wstr) -> Self {
|
||||
@@ -365,11 +339,6 @@ fn from(s: &wstr) -> Self {
|
||||
}
|
||||
}
|
||||
|
||||
fn keyword_from_string<'a>(s: impl Into<&'a wstr>) -> ParseKeyword {
|
||||
let s: &wstr = s.into();
|
||||
ParseKeyword::from(s)
|
||||
}
|
||||
|
||||
impl Default for ParseErrorCode {
|
||||
fn default() -> Self {
|
||||
ParseErrorCode::none
|
||||
@@ -608,13 +577,6 @@ pub fn token_type_user_presentable_description(
|
||||
}
|
||||
}
|
||||
|
||||
fn token_type_user_presentable_description_ffi(
|
||||
type_: ParseTokenType,
|
||||
keyword: ParseKeyword,
|
||||
) -> UniquePtr<CxxWString> {
|
||||
token_type_user_presentable_description(type_, keyword).to_ffi()
|
||||
}
|
||||
|
||||
pub type ParseErrorList = Vec<ParseError>;
|
||||
|
||||
#[derive(Clone)]
|
||||
|
||||
Reference in New Issue
Block a user