Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Schyrsivochter/ion
  • TenStrings/ion
  • wezm/ion
  • echoSayonara/ion
  • Abdillah/ion
  • luke-clifton/ion
  • mneumann/ion
  • microcolonel/ion
  • ngirard/ion
  • thebitstick/ion
  • xTibor/ion
  • BuggStream/ion
  • aignas/ion
  • juhp/ion
  • alaskacanyon/ion
  • bjorn3/ion
  • kamirr/ion
  • batzor/ion
  • redox-os/ion
  • 0verk1ll/ion
  • amecea/ion
  • tathanhdinh/ion
  • andrey.turkin/ion
  • AdminXVII/ion
  • edfloreshz/ion
  • phoebe/ion
  • sstanfield/ion
  • sahitpj/ion
  • CastilloDel/ion
  • end222/ion
  • neallred/ion
  • coleman/ion
  • colinfruit/ion
  • NateDogg1232/ion
  • chazfg/ion
  • grant.cooksey/ion
  • voidboy/ion
  • tormeh/ion
  • cdbattags/ion
  • gmacd/ion
  • aleksator/ion
  • ogkloo/ion
  • namachan10777/ion
  • zak-grumbles/ion
  • omar-mohamed-khallaf/ion
  • toshokan/ion
  • emturner/ion
  • elshize/ion
  • Galestrike/ion
  • bool_purist/ion
  • jonastoth/ion
  • asvln/ion
  • Tommoa/ion
  • dubi_steinkek/ion
  • efikarl/ion
  • jbowen/ion
  • zhaozhao/ion
  • zraktvor/ion
  • jonathandturner/ion
  • KSXGitHub/ion
  • seodisparate/ion
  • baka/ion
  • rw_van/ion
  • matu3ba/ion
  • theryangeary/ion
  • RA_GM1/ion
  • rharriso/ion
  • dardyfella/ion
  • bobogei81123/ion
  • timofey/ion
  • Shirtpantswallet/ion
  • vent/ion
  • stratact/ion
  • ids1024/ion
  • Ano-Nymus/ion
  • mimi89999/ion
  • rypervenche/ion
  • zen3ger/ion
  • BafDyce/ion
  • ilmu/ion
  • vxv/ion
  • panaman67/ion
  • jD91mZM2/ion
  • peter/ion
  • jmintb/ion
  • shanavasm/ion
  • mortona/ion
  • storyfeet/ion
  • mpajkowski/ion
  • ondono/ion
90 results
Show changes
Commits on Source (17)
Showing
with 600 additions and 455 deletions
......@@ -45,12 +45,23 @@ redox:
script:
- redoxer test
link-check:
image: hrektts/mdbook
before_script:
- apt-get update -qq
- apt-get install -qq libssl-dev pkg-config build-essential curl git
- (test -x $HOME/.cargo/bin/mdbook-linkcheck || cargo install mdbook-linkcheck)
script:
- make manual
- mdbook build manual
pages:
image: hrektts/mdbook
stage: deploy
script:
- make manual
- mdbook build -d ../public manual
- mdbook build manual
- mv manual/book/html public
artifacts:
paths:
- public
......
## Find an issue
# Contributor Guidelines
## Merge Requests
Contributors MUST:
- Discuss a feature before implementing it
- Include unit and integration tests applicable to the changes and fixes you made
- Format your code with `cargo +nightly fmt` before creating a commit
- Follow [Conventional Commit] guidelines, so that our changelogs are useful
- Squash commits, such that each commit clearly does a specific thing, either locally or using gitlab's custom checkbox.
- [Adhere to a git workflow using rebase](https://medium.com/singlestone/a-git-workflow-using-rebase-1b1210de83e5)
- Rebase upon the master branch, rather than merging it
- [Allow us to make commits on your merge request](https://docs.gitlab.com/ee/user/project/merge_requests/allow_collaboration.html)
Contributors MUST NOT:
- Have merge commits in their merge requests
- Make breaking changes without clearly documenting them in the commit
- Have commits which do not adhere to [Conventional Commit] guidelines
Contributors SHOULD NOT:
- Worry about code style, because `cargo fmt` renders this a non-issue
[conventional commit]: https://www.conventionalcommits.org/en/v1.0.0-beta.4/
## Finding an issue
First, find an area to work on within the shell or one of it's related projects.
This may be:
......@@ -34,7 +61,7 @@ integration tests.
## Test your code
Before submitting a PR, ensure that you've run your tests locally and that they
Before submitting a merge request (MR) on GitLab, ensure that you've run your tests locally and that they
pass. This can be done by running the following two commands:
```sh
......@@ -43,7 +70,7 @@ cargo +nightly test --lib && bash examples/run_examples.sh
## Format your code
In addition, format your code before submitting a PR. This will require that
In addition, format your code before submitting a MR. This will require that
you've installed the `rustfmt` Cargo component.
```sh
......@@ -52,6 +79,12 @@ cargo +nightly fmt
Now you're ready to submit your work for review!
## Sumbitting your work for review
Submitting your work on the Redox OS GitLab server can be done by creating a [merge request (MR)](https://gitlab.redox-os.org/help/user/project/merge_requests/index.md).
**Important** Make sure you [enable commit edits from upstream members](https://gitlab.redox-os.org/help/user/project/merge_requests/allow_collaboration.md#enabling-commit-edits-from-upstream-members) by clicking the *"Allow commits from members who can merge to the target branch"* checkbox.
## Chatroom
Send an email to [info@redox-os.org](mailto:info@redox-os.org) to request invitation for joining
......
This diff is collapsed.
......@@ -31,12 +31,13 @@ maintenance = { status = "experimental" }
advanced_arg_parsing = []
man = ["builtins-proc/man"]
piston = ["piston-ai_behavior", "piston_window", "piston2d-sprite"]
unicode = ["regex/unicode"]
[workspace]
members = [ "members/builtins-proc", "members/ranges", "members/scopes-rs", "members/types-rs" ]
[dev-dependencies]
criterion = "0.2"
criterion = "0.3"
serial_test = "*"
serial_test_derive = "*"
......@@ -60,30 +61,26 @@ required-features = ["piston"]
name = "ion"
path = "src/main.rs"
[build-dependencies]
version_check = "0.9"
[dependencies]
calculate = { git = "https://gitlab.redox-os.org/redox-os/calc" }
err-derive = "0.1"
glob = "0.3"
itoa = "0.4"
liner = { git = "https://gitlab.redox-os.org/redox-os/liner" }
rand = "0.7"
regex = "1.1"
regex = { version = "1.3", default-features = false, features = ["std", "perf"] }
small = { git = "https://gitlab.redox-os.org/redox-os/small", features = ["std"] }
smallvec = "0.6"
unicode-segmentation = "1.2"
unicode-segmentation = "1.3"
ion-ranges = { version = "0.1", path = "members/ranges" }
scopes = { version = "0.1", path = "members/scopes-rs" }
types-rs = { version = "0.1", path = "members/types-rs" }
builtins-proc = { version = "0.1", path = "members/builtins-proc" }
hashbrown = "0.5"
hashbrown = "0.6"
itertools = "0.8"
lexical = "2.0"
lexical = "3.0"
object-pool = "0.3.1"
auto_enums = "0.5.5"
structopt = "^0.2"
structopt = "0.3"
atty = "0.2"
permutate = "0.3"
xdg = "2.1"
......
......@@ -9,6 +9,7 @@ is developed alongside, and primarily for, RedoxOS, it is a fully capable on oth
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
[![crates.io](https://meritbadge.herokuapp.com/ion-shell)](https://crates.io/crates/ion-shell)
[![Documentation](https://img.shields.io/badge/documentation-blue)](https://doc.redox-os.org/ion-manual/html)
> Ion is still a WIP, and both its syntax and rules are subject to change over time. It is
> still quite a ways from becoming stabilized, but we are getting very close. Changes to the
......@@ -23,10 +24,19 @@ yet to be written into the specification.
# Ion Manual
The Ion manual is generated automatically on each commit via [mdBook](https://github.com/azerupi/mdBook).
The manual is located [here](https://doc.redox-os.org/ion-manual/) on Redox OS's website. It is
also included in the source code for Ion, within the **manual** directory, which you may build
with **mdbook**.
[The Ion manual online](https://doc.redox-os.org/ion-manual/html)
is generated automatically on each commit via [mdBook](https://github.com/azerupi/mdBook) and hosted on Redox OS's website.
**Building the manual for local reference**
Sources for the manual are located in the `manual` directory.
You can build the manual using
```sh
make manual
mdbook build -d ../public manual
```
# Ion library example
See the [examples folder](https://gitlab.redox-os.org/redox-os/ion/tree/master/examples) and the [Parallelion project](https://gitlab.redox-os.org/AdminXVII/parallelion)
......@@ -35,7 +45,7 @@ See the [examples folder](https://gitlab.redox-os.org/redox-os/ion/tree/master/e
## Pop!\_OS / Ubuntu
The following PPA supports the 18.04 (bionic) and 18.10 (cosmic) releases. Bionic builds were made using the Pop\_OS PPA's rustc 1.35.0 package.
The following PPA supports the 18.04 (bionic) and 19.04 (disco) releases. Bionic builds were made using the Pop\_OS PPA's rustc 1.35.0 package.
```
sudo add-apt-repository ppa:mmstick76/ion-shell
......
......@@ -5,24 +5,15 @@ use itertools::Itertools;
const TEXT: &[u8] = include_bytes!("test.ion");
fn criterion_benchmark(c: &mut Criterion) {
let stmts = TEXT
.iter()
.cloned()
.batching(|lines| Terminator::new(lines).terminate())
.collect::<Vec<_>>();
c.bench(
"statement-splitter-throughput",
ParameterizedBenchmark::new(
"statement",
|b, script| {
b.iter(|| {
script.iter().flat_map(|cmd| StatementSplitter::new(cmd)).collect::<Vec<_>>()
})
},
vec![stmts],
)
.throughput(|script| Throughput::Bytes(script.len() as u32)),
);
let mut group = c.benchmark_group("statement-splitter-Throughput");
for stmt in TEXT.iter().cloned().batching(|lines| Terminator::new(lines).terminate()) {
group.throughput(Throughput::Bytes(stmt.len() as u64));
group.bench_with_input(BenchmarkId::new("statement", stmt.len()), &stmt, |b, stmt| {
b.iter(|| StatementSplitter::new(stmt).collect::<Vec<_>>())
});
}
}
criterion_group!(benches, criterion_benchmark);
......
......@@ -5,10 +5,13 @@ const TEXT: &str = include_str!("test.ion");
const EOF: &str = include_str!("herestring.ion");
fn criterion_benchmark(c: &mut Criterion) {
c.bench(
"terminator-throughput",
ParameterizedBenchmark::new(
"terminator",
let mut group = c.benchmark_group("terminator-Throughput");
for script in &[TEXT, EOF] {
group.throughput(Throughput::Bytes(script.len() as u64));
group.bench_with_input(
BenchmarkId::new("terminator", script.len()),
&script,
|b, script| {
b.iter(|| {
let mut bytes = script.bytes().peekable();
......@@ -17,10 +20,8 @@ fn criterion_benchmark(c: &mut Criterion) {
}
})
},
vec![TEXT, EOF],
)
.throughput(|script| Throughput::Bytes(script.len() as u32)),
);
);
}
}
criterion_group!(benches, criterion_benchmark);
......
[book]
title = "Ion Documentation"
description = "A modern system shell that features a simple, yet powerful, syntax. Written entirely in Rust."
authors = ["Michael Murphy", "Xavier L'Heureux", "Jeremy Soller"]
language = "en"
[build]
create-missing = false
[output.html]
git-repository-url = "https://gitlab.redox-os.org/redox-os/ion"
git-repository-icon = "fa-github"
[output.linkcheck]
# Should we check links on the internet? Enabling this option adds a
# non-negligible performance impact
follow-web-links = false
# Are we allowed to link to files outside of the book's root directory? This
# may help prevent linking to sensitive files (e.g. "../../../../etc/shadow")
traverse-parent-directories = false
......@@ -2,7 +2,7 @@
- [Introduction](introduction.md)
- [Migrating from POSIX shells](migration.md)
- [Migrating from POSIX shells](migrating.md)
- [Miscellaneous](misc/index.md)
......
......@@ -72,17 +72,17 @@ DESCRIPTION
```txt
SYNOPSIS
starts_with <PATTERN> tests...
contains <PATTERN> tests...
DESCRIPTION
Returns 0 if any argument starts_with contains the first argument, else returns 0
Returns 0 if any given argument contains the first argument, else returns 1
```
## dir_depth - set the dir stack depth
## dir-depth - set the dir stack depth
```txt
SYNOPSYS
dir_depth [DEPTH]
dir-depth [DEPTH]
DESCRIPTION
If DEPTH is given, set the dir stack max depth to DEPTH, else remove the limit
......@@ -155,14 +155,14 @@ OPTIONS
\v vertical tab (VT)
```
## ends_with - check if a given string starts with another one
## ends-with - check if a given string starts with another one
```txt
SYNOPSIS
starts_with <PATTERN> tests...
ends-with <PATTERN> tests...
DESCRIPTION
Returns 0 if any argument starts_with contains the first argument, else returns 0
Returns 0 if any argument ends with the first argument, else returns 1
```
## eval - evaluates the specified commands
......@@ -305,7 +305,7 @@ SYNOPSIS
is [ -h | --help ] [not]
DESCRIPTION
Returns 0 if the two arguments are equal
Returns 0 if the two arguments are equal, and 1 otherwise.
OPTIONS
not
......@@ -319,7 +319,7 @@ SYNOPSIS
isatty [FD]
DESCRIPTION
Returns 0 exit status if the supplied file descriptor is a tty.
Returns 0 if the supplied file descriptor is a tty, and 1 otherwise.
```
## jobs - list all jobs running in the background
......@@ -428,14 +428,14 @@ DESCRIPTION
variables will affect the current shell because of this.
```
## starts_with - check if a given string starts with another one
## starts-with - check if a given string starts with another one
```txt
SYNOPSIS
starts_with <PATTERN> tests...
starts-with <PATTERN> tests...
DESCRIPTION
Returns 0 if any argument starts_with contains the first argument, else returns 0
Returns 0 if any given argument starts with the first argument, else returns 1
```
## status - Evaluates the current runtime status
......
......@@ -17,11 +17,11 @@ that `1` should indicate success, and `0` should indicate a general error, so th
found in POSIX shells will be preserved.
We supply a number of builtin commands that are utilized for the purpose of evaluating
expressions and values that we create within our shell. One of these commands is the `test`
builtin, which is commonly found in other POSIX shells, and whose flags and operation should
be identical. **TODO: Insert Manual Page Link To Our Implementation** We also supply a `not`
builtin, which may be convenient to use in conjuction with other commands in order to flip
the exit status; and a `matches` builtin that performs a regex-based boolean match.
expressions and values that we create within our shell. One of these commands is the [`test`
builtin](../builtins.md#test---perform-tests-on-files-and-text), which is commonly found
in other POSIX shells, and whose flags and operation should be identical.
We also supply a `not` builtin, which may be convenient to use in conjuction with other commands
in order to flip the exit status; and a `matches` builtin that performs a regex-based boolean match.
```sh
if test "foo" = $foo
......
......@@ -62,9 +62,6 @@ for elem in @split("some, comma-separated, values" ", "); echo $elem; end
The following are the currently-supported string methods:
- [ends_with](#ends_with)
- [contains](#contains)
- [starts_with](#starts_with)
- [basename](#basename)
- [extension](#extension)
- [filename](#filename)
......@@ -84,63 +81,6 @@ The following are the currently-supported string methods:
- [unescape](#unescape)
- [or](#or)
### ends_with
Defaults to string variables. When supplied with a pattern, it will return one if the string
ends with it. Zero otherwise.
#### Examples
```sh
echo $ends_with("FOOBAR" "BAR")
echo $ends_with("FOOBAR" "FOO")
```
#### Output
```
1
0
```
### contains
Defaults to string variables. When supplied with a pattern, it will return one if the string
contains with it. Zero otherwise.
#### Examples
```sh
echo $contains("FOOBAR" "OOB")
echo $contains("FOOBAR" "foo")
```
#### Output
```
1
0
```
### starts_with
Defaults to string variables. When supplied with a pattern, it will return one if the string
starts with it. Zero otherwise.
#### Examples
```sh
echo $starts_with("FOOBAR" "FOO")
echo $starts_with("FOOBAR" "BAR")
```
#### Output
```
1
0
```
### basename
Defaults to string variables. When given a path-like string as input, this will return the
......@@ -347,11 +287,13 @@ three two one two
one three one three
```
### regex_replace
### regex\_replace
Defaults to string variables. Equivalent to `replace`, but the first argument will be treated
as a regex.
**PS:** By default, unicode support will be disabled to trim the size of Ion. Add the "unicode" flag to enable it.
#### Examples
```sh
......
......@@ -54,7 +54,7 @@ As another example:
```
fn hello name age:int hobbies:[str]
echo $name ($age) has the following hobbies:
echo "$name ($age) has the following hobbies:"
for hobby in @hobbies
echo " $hobby"
end
......@@ -71,7 +71,7 @@ As with any other statement, you can pipe functions using `read`.
```sh
fn format_with pat
read input
echo $join(@split(input), $pat)
echo $join(@split($input) $pat)
end
echo one two three four five | format_with "-"
......
# Command history
## General
- Ions history can be found at **$HOME/.local/share/ion/history**
- The `history` builtin can be used to display the entire command history
- If you're only interested in the last X entries, use `history | tail -n X`
- The histories\' behavior can be changed via various local variables (see section
**Variables**)
- Unlike other shells, `ion` saves repeated commands only once:
The `history` builtin command can be used to display the command history:
- to display the entire command history, type `history` ;
- if you're only interested in the last N entries, type `history | tail -N`.
Its behavior can be changed via various local variables (see [Variables](#Variables) below).
Ion's history file is located by default in `$HOME/.local/share/ion/history`.
Unlike other shells, Ion by default saves repeated commands only once:
```sh
# echo "Hello, world!"
Hello, world!
......@@ -20,24 +22,57 @@ false
```
## Variables
The following local variables can be used to modify Ions history behavior:
### HISTORY_SIZE
Determines how many entries of the history are kept in memory.
Default value is **1000**.
Ideally, this value should be the same as `HISTFILE_SIZE`
The following local variables can be used to modify Ion's history behavior:
### HISTFILE
The file into which the history should be saved. At Ion' startup, the history will be read
from this file, and when it exits, the session's history will be appended to this file.
**Default value:** `$HOME/.local/share/ion/history`
### HISTFILE_ENABLED
Whether the history should be read from/written into the file specified by `HISTFILE`.
**Default value:** `1`
A value of `1` means yes, everything else means no.
### HISTFILE_SIZE
The maximum number of lines kept in the history file when flushed from memory.
**Default value:** `100000`
It is useless to set this to a higher value than `HISTORY_SIZE`. Ideally, those variables
would have the same value, since this would otherwise result in loss of information on history
write to disk, which might not be worth it given the nowadays cheap hardware space.
**(Currently ignored)**
### HISTORY_IGNORE
Specifies which commands should **NOT** be saved in the history.
This is an array and defaults to an **empty array**, meaning that all commands will be saved.
Which commands should *not* be saved in the history.
**Default value:** `[ no_such_command whitespace duplicates ]`
Each element of the array can take one of the following options:
- **all** -> All commands are ignored, nothing will be saved in the history.
- **no_such_command** -> Commands which return `NO_SUCH_COMMAND` will not be saved in the history.
- **whitespace** -> Commands which start with a [whitespace character](https://doc.rust-lang.org/stable/reference/whitespace.html) will not be saved in the
history.
- **regex:xxx** -> Where xxx is treated as a [regular expression](https://doc.rust-lang.org/regex/regex/index.html).
Commands which match this regular expression will not be saved in the history.
- **duplicates** -> All preceding duplicate commands are removed/ignored from the history after a matching command is entered.
- `all` <br/>
All commands are ignored, nothing will be saved in the history.
- `no_such_command` <br/>
Commands which return `NO_SUCH_COMMAND` will not be saved in the history.
- `whitespace` <br/>
Commands which start with a [whitespace character](https://doc.rust-lang.org/stable/reference/whitespace.html) will not be saved in the
history.
- `regex:xxx` <br/>
Where xxx is treated as a [regular expression](https://doc.rust-lang.org/regex/regex/index.html).
Commands which match this regular expression will not be saved in the history.
- `duplicates` <br/>
All preceding duplicate commands are removed/ignored from the history after a matching command is entered.
Specifying an empty array, means that all commands will be saved.
**Notes**
- You can specify as many elements as you want.
......@@ -49,22 +84,23 @@ Commands which match this regular expression will not be saved in the history.
- As all variables, `HISTORY_IGNORE` is not saved between sessions. It is suggested to set it via
ions init file.
- The `let HISTORY_IGNORE = [ .. ]` command itself is **not effected** except if the assignment
command starts with a whitespace and the **whitespace** element is specified in this assignment.
See the following example:
```sh
# echo @HISTORY_IGNORE
command starts with a whitespace and the **whitespace** element is specified in this assignment.
See the following example:
```sh
# echo @HISTORY_IGNORE
# let HISTORY_IGNORE = [ all ] # saved
# let HISTORY_IGNORE = [ whitespace ] # saved
# true # ignored
# let HISTORY_IGNORE = [ ] # saved
# let HISTORY_IGNORE = [ whitespace ] # ignored
# history
echo @HISTORY_IGNORE
let HISTORY_IGNORE = [ all ] # saved
let HISTORY_IGNORE = [ whitespace ] # saved
let HISTORY_IGNORE = [ ] # saved
```
# let HISTORY_IGNORE = [ all ] # saved
# let HISTORY_IGNORE = [ whitespace ] # saved
# true # ignored
# let HISTORY_IGNORE = [ ] # saved
# let HISTORY_IGNORE = [ whitespace ] # ignored
# history
echo @HISTORY_IGNORE
let HISTORY_IGNORE = [ all ] # saved
let HISTORY_IGNORE = [ whitespace ] # saved
let HISTORY_IGNORE = [ ] # saved
```
**Examples**
```sh
......@@ -83,27 +119,28 @@ let HISTORY_IGNORE = [ whitespace ] # saved
# trulse # ignored
```
**Tips**
**Tip**
I like to add `regex:#ignore$` to my `HISTORY_IGNORE`.
That way, whenever I want to ignore a command on the fly, I just need to add `#ignore` to the
end of the line.
### HISTFILE_ENABLED
Specifies whether the history should be read from/written into the file specified by `HISTFILE`.
A value of **1** means yes, everything else means no. Defaults to **1**.
### HISTORY_SIZE
### HISTFILE
The file into which the history should be saved. At the launch of ion the history will be read
from this file and when ion exits, the history of the session will be appended into the file.
Defaults to **$HOME/.local/share/ion/history**
The maximum number of lines contained in the command history in-memory.
### HISTFILE_SIZE
Specifies how many commands should be saved in `HISTFILE` at most.
Ideally, this should have the same value as `HISTORY_SIZE`.
Defaults to **100000**.
**Default value:** `1000`
Ideally, this value should be the same as `HISTFILE_SIZE` (see `HISTFILE_SIZE` for details).
**(Currently ignored)**
### HISTORY_TIMESTAMP
Specifies whether a corresponding timestamp should be recorded along with each command.
Whether a corresponding timestamp should be recorded along with each command.
The timestamp is indicated with a `#` and is unformatted as the seconds since the unix epoch.
This feature is disabled by default and can be enabled by executing the following command: `let HISTORY_TIMESTAMP = 1`.
**Default value:** `0`
Possible values are `0` (disabled) and `1` (enabled).
......@@ -7,7 +7,7 @@ Redirection will write the output of a command to a file.
### Redirect Stdout
```sh
command > stderr
command > stdout
```
### Redirect Stderr
......
......@@ -52,7 +52,7 @@ let other_array = [ this is the ion ]
let array = [ @array @other_array shell ]
let as_string = @array
echo @array
echo $array
echo $as_string
```
```
......
......@@ -18,7 +18,7 @@ let hashmap:hmap[str] = [ foo=hello bar=world fizz=I buzz=was bazz=here ]
let btreemap:bmap[str] = [ foo=hello bar=world fizz=I buzz=was bazz=here ]
```
## Fetch a variables by key
## Fetch a variable by key
```
let x = bazz
......
......@@ -5,9 +5,9 @@ authors = ["Xavier L'Heureux <xavier.lheureux@icloud.com>"]
edition = "2018"
[dependencies]
quote = "0.6"
syn = { version = "0.15", features = ["full"] }
darling = "0.9"
quote = "1.0"
syn = { version = "1.0", features = ["full"] }
darling = "0.10"
[dev-dependencies]
ion-shell = { path = "../.." }
......
......@@ -22,15 +22,15 @@ struct MacroArgs {
pub fn builtin(attr: TokenStream, item: TokenStream) -> TokenStream {
let input = syn::parse_macro_input!(item as syn::ItemFn);
let attrs = syn::parse_macro_input!(attr as syn::AttributeArgs);
let syn::ItemFn { vis, decl, block, ident, .. } = &input;
let syn::FnDecl { ref fn_token, ref inputs, ref output, .. } = **decl;
let syn::ItemFn { vis, sig, block, .. } = &input;
let syn::Signature { ident, fn_token, inputs, output, .. } = sig;
let args = match MacroArgs::from_list(&attrs) {
Ok(v) => v,
Err(e) => return e.write_errors().into(),
};
let name = syn::Ident::new(&format!("builtin_{}", &ident), input.ident.span());
let name = quote::format_ident!("builtin_{}", &ident, span = ident.span());
let help = args.help.trim();
let names = args.names.unwrap_or_else(|| ident.to_string());
......
......@@ -11,4 +11,4 @@ keywords = ["scopes", "variables"]
categories = ["data-structures", "memory-management"]
[dependencies]
hashbrown = "0.5"
hashbrown = "0.6"