Skip to content

Releases: magicant/yash-rs

yash-cli-0.2.0

14 Dec 03:59
yash-cli-0.2.0
Compare
Choose a tag to compare

[0.2.0] - 2024-12-14

Added

  • A case branch now can be terminated with ;& or ;| instead of ;; to fall
    through to the next branch or to resume pattern matching from the next branch,
    respectively. ;& is a POSIX.1-2024 feature, and ;| is an extension. For
    compatibility with other shells, ;;& is also accepted as an alias for ;|.
  • Dollar-single-quotes are now supported as a form of quoting where backslash
    escapes are recognized.
    • Currently, octal and hexadecimal escapes that expand to a value greater
      than 127 are translated to a UTF-8 sequence for the corresponding Unicode
      scalar value. This behavior does not conform to POSIX.1-2024 and is
      subject to change.
    • As an extension to POSIX.1-2024, the shell also recognizes the \u and
      \U escapes for Unicode scalar values, and the \E escape as a synonym
      for \e.

Changed

  • The shell's syntax now allows esac as the first pattern of a case branch
    as in case esac in (esac|case) echo ok; esac. Previously, it was a syntax
    error, but POSIX.1-2024 allows it.
  • The bg built-in now updates the ! special parameter to the process ID of
    the background job, as required by POSIX.1-2024.
  • The exec built-in no longer exits the shell when the specified command is
    not found in an interactive shell, as required by POSIX.1-2024.

Fixed

  • The interactive shell now discards the entire line when a syntax error occurs
    in the middle of a command line. Previously, it would continue parsing the
    rest of the line, which could lead to confusing behavior.

yash-cli-0.1.0

28 Sep 16:25
yash-cli-0.1.0
Compare
Choose a tag to compare

[0.1.0] - 2024-09-29

This is the first non-beta release of yash-rs. This version implements most interactive shell features required by POSIX, except for command history and line editing.

Added

  • The shell now runs the initialization file specified by the ENV environment
    variable if it is set and the shell is interactive.

Changed

  • The shell now rejects an invalid parameter as a syntax error. Specifically,
    if a parameter starts with a digit but is not a valid number, the shell now
    reports a syntax error instead of treating it as a variable. For example,
    ${1abc} and ${0_1} are now syntax errors.
  • Improved error messages for some parameter expansion errors.
  • Interactive shells now report updates to job status before showing the prompt.
  • Interactive shells no longer exit on shell errors such as syntax errors.
  • Interactive shells now ignore the noexec option.
  • Interactive shells now support the ignoreeof option.
  • Interactive shells now allow modifying the trap for signals that were ignored
    on the shell startup.

Fixed

  • When the shell cannot open a script specified by the command-line argument,
    it now returns the exit status of 126 or 127 as required by POSIX. Previously,
    it returned the exit status of 2.

yash-syntax-0.11.0

22 Aug 15:08
yash-syntax-0.11.0
Compare
Choose a tag to compare

[0.11.0] - 2024-08-22

Added

  • The following functions are now const:
    • parser::lex::is_portable_name_char
    • parser::lex::is_special_parameter_char
  • The parser::lex::is_single_char_name const function is added.
  • A new syntax::Param struct is introduced to represent a parameter in
    parameter expansions (syntax::TextUnit::RawParam and syntax::BracedParam).
    New enum types syntax::SpecialParam and syntax::ParamType are added to
    represent the details of the parameter. Note that the former syntax::Param
    struct is renamed to syntax::BracedParam.
  • The parser::SyntaxError::InvalidParam variant is added, which is returned
    when a parameter expansion has an invalid name.
  • The source::Source enum is extended with new variants VariableValue,
    InitFile, and Other.

Changed

  • syntax::Param has been renamed to syntax::BracedParam.
  • The syntax::TextUnit::RawParam variant now has a param: syntax::Param
    field instead of a name: String field.
  • The syntax::BracedParam struct (formerly syntax::Param) now has a
    param: syntax::Param field instead of a name: String field.
  • source::Source::label now returns "<arithmetic_expansion>" for
    Source::Arith. Previously, it returned "<arith>".
  • The parser::lex::WordLexer::braced_param method now returns
    parser::SyntaxError::InvalidParam if the parameter starts with a digit but
    contains a non-digit character.
  • External dependency versions:
    • Rust 1.77.0 → 1.79.0

yash-env-0.3.0

22 Aug 15:09
yash-env-0.3.0
Compare
Choose a tag to compare

[0.3.0] - 2024-08-22

Added

  • This crate now builds on non-Unix platforms. However,
    system::real::RealSystem is only available on Unix platforms.
  • The OfdAccess, OpenFlag, FdFlag, Mode, RawMode, Uid, RawUid,
    Gid, RawGid, FileType, Stat, and SigmaskOp types in the system
    module
  • The System trait now has the ofd_access, get_and_set_nonblocking,
    getuid, geteuid, getgid, and getegid methods.
  • Mode has been moved from system::virtual to system and now has constants
    with more human-friendly names, e.g., USER_READ and GROUP_WRITE.
  • The system::virtual::Inode struct now has the stat method.
  • The system::virtual::FileBody struct now has the type and size methods.
  • The system::virtual::Process struct now has the getters/setters for the
    real/effective user/group IDs: uid, set_uid, euid, set_euid, gid,
    set_gid, egid, and set_egid.
  • system::virtual::VirtualSystem::open now applies the process's umask to the
    mode argument.
  • The job::RawPid type has been added to represent the contents of job::Pid.
  • The stack::Frame enum now has the InitFile variant.
  • The crate now re-exports unix_path as path and unix_str as str.
  • External dependencies:
    • enumset 1.1.2 (previously an internal dependency)
    • unix_path 1.0.1
    • unix_str 1.0.0
  • Internal dependencies:
    • bitflags 2.6.0
    • nix 0.29.0 (with the "fs", "signal", and "user" features enabled)

Changed

  • system::FdFlag is no longer a re-export of nix::fcntl::FdFlag.
  • system::Mode is no longer a re-export of nix::sys::stat::Mode.
  • All APIs that handle std::path::Path, std::path::PathBuf, std::ffi::OsStr,
    and std::ffi::OsString now use path::Path, path::PathBuf, str::OsStr,
    and str::OsString instead.
    • system::DirEntry::name
    • system::System::confstr_path
    • system::System::getcwd
    • system::System::getpwnam_dir
    • system::System::open_tmpfile
    • system::virtual::FileBody::Directory::files
    • system::virtual::FileBody::Symlink::target
    • system::virtual::FileSystem::get
    • system::virtual::FileSystem::save
    • system::virtual::Process::chdir
    • system::virtual::SystemState::home_dirs
    • system::virtual::SystemState::path
    • system::virtual::VirtualDir::new
  • system::SignalHandling has been renamed to system::Disposition.
  • In the system::virtual::Process struct, the following methods have been
    renamed:
    • signal_handlingdisposition
    • set_signal_handlingset_disposition
  • In the trap::SignalSystem trait, the set_signal_handling method has been
    renamed to set_disposition.
  • In the trap::TrapSet struct, the following methods have been renamed:
    • enable_sigchld_handlerenable_internal_disposition_for_sigchld
    • enable_terminator_handlersenable_internal_dispositions_for_terminators
    • enable_stopper_handlersenable_internal_dispositions_for_stoppers
    • disable_terminator_handlersdisable_internal_dispositions_for_terminators
    • disable_stopper_handlersdisable_internal_dispositions_for_stoppers
    • disable_internal_handlersdisable_internal_dispositions
  • The fstat and fstatat methods of system::System now return a Stat
    instead of a nix::sys::stat::FileStat.
  • The system::System::fstatat method now takes a follow_symlinks: bool
    parameter instead of an AtFlags parameter.
  • The system::System::open method has been redefined to take OfdAccess and
    OpenFlag parameters instead of nix::fcntl::OFlag.
  • The system::System::isatty method now returns a bool instead of a
    system::Result<bool>.
  • The system::System::umask method now takes and returns a value of the new
    system::Mode type.
  • The system::System::sigmask method now takes a SigmaskOp parameter instead
    of a nix::sys::signal::SigmaskHow parameter.
  • The system::System::select method now takes Vec<io::Fd> parameters instead
    of fd_set::FdSet parameters. It also takes a Duration instead of a
    nix::sys::time::TimeSpec for the optional timeout parameter.
  • The dup, fcntl_getfl, and fcntl_setfl methods of system::System now
    operate on an EnumSet<FdFlag> parameter instead of an nix::fcntl::FdFlag
    parameter.
  • The getrlimit and setrlimit methods of system::System now returns an
    error of type system::Errno instead of std::io::Error.
  • In the system::resource module:
    • The rlim_t type has been renamed to Limit.
    • The RLIM_INFINITY constant has been renamed to INFINITY.
  • The flags: enumset::EnumSet<FdFlag> field of
    yash_env::system::virtual::FdBody has replaced
    the flag: nix::fcntl::FdFlag field.
  • The system::virtual::INode struct has been renamed to Inode.
  • The system::virtual::OpenFileDescription::i_node method has been renamed to
    inode and now returns a reference to Rc<RefCell<Inode>> rather than a
    clone of it.
  • The system::virtual::OpenFileDescription::seek method now takes a
    std::io::SeekFrom parameter instead of an offset and whence pair.
  • The system::virtual::VirtualSystem::select method now treats as ready file
    descriptors that are contained in readers but not readable, or in writers
    but not writable. Previously, the method returned an EBADF error in these
    cases.
  • External dependency versions:
    • Rust 1.77.0 → 1.79.0
    • yash-syntax 0.10.0 → 0.11.0

Deprecated

  • system::virtual::Mode in favor of system::Mode

Removed

  • The system module no longer reexports nix::fcntl::AtFlags,
    nix::fcntl::OFlag, nix::sys::stat::FileStat, nix::sys::stat::SFlag,
    nix::sys::signal::SigmaskHow, and nix::sys::time::TimeSpec.
  • The fcntl_getfl and fcntl_setfl methods from the System trait
  • The system::Errno struct's last and clear methods are no longer public.
  • The system::resource::Resource::as_raw_type method is no longer public.
  • All the fields of the system::virtual::OpenFileDescription struct are now
    private.
  • The system::fd_set module
  • impl TryFrom<semantics::ExitStatus> for nix::sys::signal::Signal
  • impl From<job::Pid> for nix::unistd::Pid
  • impl From<nix::unistd::Pid> for job::Pid
  • impl From<system::resource::LimitPair> for nix::libc::rlimit
  • impl From<nix::libc::rlimit> for system::resource::LimitPair
  • External dependencies:
    • nix 0.27.0 (now an internal dependency with the "fs", "signal" and "user"
      features enabled)

yash-syntax-0.10.0

12 Jul 15:01
yash-syntax-0.10.0
Compare
Choose a tag to compare

[0.10.0] - 2024-07-12

Added

  • source::Code::line_number
    • This new method returns the line number of a particular character in the
      code.
  • alias::Glossary
    • This new trait is now used as an interface to provide the parser with
      alias definitions.
  • impl<T> input::Input for T where T: DerefMut<Target: input::Input>
    • This new trait implementation allows more types to be used as input
      sources, especially when it is used with a decorator that requires
      another input source.
  • input::Context::is_first_line
    • This new method allows changing the behavior of the input function
      depending on whether the current line is the first line of the input.
    • The corresponding setter method set_is_first_line is also added.

Changed

  • External dependency versions:
    • Rust 1.70.0 → 1.77.0
    • annotate-snippets 0.10.0 → 0.11.4
  • source::Code::source is now Rc<Source> instead of Source.
    • This change is made to avoid cloning the Source object when the Lexer
      flushes its buffer and creates a new Code object sharing the same
      Source.
    • The lexer constructor Lexer::new now takes Rc<Source> instead of
      Source.
    • The lexer constructor Lexer::from_memory now takes a generic parameter
      that can be converted to Rc<Source>.
  • The second argument of parser::Parser::new is now &dyn alias::Glossary
    instead of &alias::AliasSet.

Fixed

  • Small performance improvements

yash-semantics-0.3.0

12 Jul 16:08
yash-semantics-0.3.0
Compare
Choose a tag to compare

[0.3.0] - 2024-07-13

Added

  • read_eval_loop
    • This function replaces the ReadEvalLoop struct and its methods.
      It supports the yash_env::input::Echo decorator by taking a
      &RefCell<&mut Env>.
  • ReadEvalLoop now has the must_use attribute.

Changed

  • External dependency versions:
    • Rust 1.75.0 → 1.77.0
    • yash-syntax 0.9.0 → 0.10.0

Deprecated

  • ReadEvalLoop::set_verbose in favor of yash_env::input::Echo

Removed

  • Internal dependencies:
    • futures-util 0.3.28

Fixed

  • Small performance improvements

yash-prompt-0.1.0

12 Jul 16:09
yash-prompt-0.1.0
Compare
Choose a tag to compare

[0.1.0] - 2024-07-13

Added

  • Initial implementation of the yash-prompt crate

yash-env-test-helper-0.1.0

12 Jul 15:03
yash-env-test-helper-0.1.0
Compare
Choose a tag to compare

[0.1.0] - 2024-07-12

Added

  • Initial implementation of the yash-env-test-helper crate

yash-env-0.2.1

12 Jul 15:02
yash-env-0.2.1
Compare
Choose a tag to compare

[0.2.1] - 2024-07-12

Added

  • Env::is_interactive
  • impl yash_system::alias::Glossary for Env
  • input::Echo
    • This is a decorator of Input that implements the behavior of the verbose shell option.
  • input::FdReader is now marked #[must_use].
  • variable::VariableSet::get_scalar
    • This is a convenience method that returns a scalar variable as a Cow<str>.
  • Variable name constants in the variable module:
    CDPATH, ENV, HOME, IFS, LINENO, OLDPWD, OPTARG, OPTIND,
    PATH, PPID, PS1, PS2, PS4, PWD
  • Variable initial value constants in the variable module:
    IFS_INITIAL_VALUE, OPTIND_INITIAL_VALUE, PS1_INITIAL_VALUE_NON_ROOT,
    PS1_INITIAL_VALUE_ROOT, PS2_INITIAL_VALUE, PS4_INITIAL_VALUE
  • impl System for &SharedSystem and impl trap::SignalSystem for &SharedSystem
    • This allows SharedSystem to be used as a system behind a non-mutable reference.

Changed

  • External dependency versions:
    • Rust 1.70.0 → 1.77.0
    • yash-syntax 0.9.0 → 0.10.0
  • Internal dependency versions:
    • annotate-snippets 0.10.0 → 0.11.4
  • All inherent methods of SharedSystem now take &self instead of &mut self:
    • SharedSystem::read_async
    • SharedSystem::write_all
    • SharedSystem::print_error

Deprecated

  • input::FdReader::set_echo in favor of input::Echo

Fixed

  • stack::Stack::loop_count no longer counts loops below a Frame::Trap(_) frame.
  • Possible undefined behavior in RealSystem::times

yash-cli-0.1.0-beta.2

12 Jul 16:13
yash-cli-0.1.0-beta.2
Compare
Choose a tag to compare

[0.1.0-beta.2] - 2024-07-13

Added

  • Internal dependencies:
    • yash-prompt 0.1.0

Changed

  • External dependency versions:
    • Rust 1.75.0 → 1.77.0
  • Internal dependency versions:
    • yash-builtin 0.2.0 → 0.3.0
    • yash-semantics 0.2.0 → 0.3.0
    • yash-syntax 0.9.0 → 0.10.0
  • The shell now shows the prompt before reading the input in the interactive mode.
    To achieve this, the startup::prepare_input function now applies the
    yash_prompt::Prompter decorator to the returned source input.
  • The first argument to startup::prepare_input is now env: &'a RefCell<&mut Env>
    instead of system: &mut SharedSystem. This change is to allow the function to
    construct yash_env::input::Echo for the returned source input.

Removed

  • startup::SourceInput::verbose
    • The caller of startup::prepare_input is no longer responsible for setting
      the verbose flag of the read-eval loop. The behavior of the verbose option
      is now implemented in yash_env::input::Echo, which is included in
      the startup::SourceInput::input field.

Fixed

  • The break and continue built-ins no longer allow exiting a trap.
  • The read built-in now shows a prompt when reading a continued line.
  • The source built-in now echoes the input when the verbose shell option is set.
  • The set built-in no longer sets the SIGTTIN, SIGTTOU, and SIGTSTP signals
    to be ignored when invoked with the -m option in a subshell of an
    interactive shell.