mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
all: change optional to result of io (#16075)
This commit is contained in:
parent
6e46933c55
commit
f6844e9766
187 changed files with 1885 additions and 1874 deletions
|
@ -5,7 +5,7 @@ import os
|
|||
const numeric_char = [`0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `.`, `e`, `E`]
|
||||
|
||||
// Convert expression to Reverse Polish Notation.
|
||||
fn expr_to_rev_pol(expr string) ?[]string {
|
||||
fn expr_to_rev_pol(expr string) ![]string {
|
||||
if expr == '' {
|
||||
return error('err: empty expression')
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ fn expr_to_rev_pol(expr string) ?[]string {
|
|||
}
|
||||
|
||||
// Evaluate the result of Reverse Polish Notation.
|
||||
fn eval_rev_pol(rev_pol []string) ?f64 {
|
||||
fn eval_rev_pol(rev_pol []string) !f64 {
|
||||
mut stack := []f64{}
|
||||
for item in rev_pol {
|
||||
if is_num_string(item) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue