Coder Social home page Coder Social logo

adventurescript's People

Contributors

patataofcourse avatar

Stargazers

 avatar

Watchers

 avatar  avatar

adventurescript's Issues

Make tests

They may be useful for detecting regressions

Empty lists are parsed as containing None

If you try to make an empty list, it will add a None object to it. This is due to the very buggy current implementation where an empty space gets parsed as a None type argument, for use with unary operators.

Because of this, unary operations should probably be rewritten to use a completely different system, or a separate Empty type should be added instead, which will only be accessible internally.

Panic on consecutive "enclosing items" (lists, strings, maps)

Example:

["game over & other shit", {gameover}] ["exit", None]

Panic shown:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', src/parsing/mod.rs:349:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Panic on nested list

Probably a fault of simplifying in brackets mode, gotta check that bracket detecting method.

Backtrace:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', src/parsing.rs:341:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/panicking.rs:101:14
   2: core::result::unwrap_failed
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/result.rs:1617:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/result.rs:1299:23
   4: adventure_script::parsing::evaluate
             at ./src/parsing.rs:339:25
   5: adventure_script::parsing::parse_text
             at ./src/parsing.rs:57:25
   6: adventure_script::parsing::parse_line
             at ./src/parsing.rs:23:26
   7: adventure_script::AdventureScriptGame::run
             at ./src/lib.rs:42:19
   8: adventure_script::main
             at ./src/main.rs:5:5
   9: core::ops::function::FnOnce::call_once
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.