Code Monkey home page Code Monkey logo

prolog_parser's People

Contributors

vladnosiv avatar

Watchers

 avatar  avatar

prolog_parser's Issues

Лексер кидает ислючения

В случае лексической ошибки программа кидает исключение, вместо того, чтобы сообщить о неуспешном разборе.

Вход: 1 :- f.
Выход:

** (MatchError) no match of right hand side value: {:error, {1, :lexer, {:illegal, '1'}}, 1}
    (prolog_parser 0.1.0) lib/prolog_parser.ex:68: PrologParser.check_syntax/1
    (elixir 1.10.4) lib/kernel/cli.ex:124: anonymous fn/3 in Kernel.CLI.exec_fun/2

HW05: Исключения на некорректных программах

e01.txt

** (Protocol.UndefinedError) protocol Enumerable not implemented for "Incorrect Prolog definition." of type BitString. This protocol is implemented for the following type(s): GenEvent.Stream, File.Stream, IO.Stream, Function, Range, HashSet, Map, MapSet, List, Date.Range, Stream, HashDict
    (elixir 1.10.4) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir 1.10.4) lib/enum.ex:141: Enumerable.reduce/3
    (elixir 1.10.4) lib/enum.ex:3383: Enum.reduce/3
    (prolog_parser 0.1.0) lib/cli.ex:17: PrologParser.CLI.file_mode/1
    (elixir 1.10.4) lib/kernel/cli.ex:124: anonymous fn/3 in Kernel.CLI.exec_fun/2

Не стоит кидать в пользователя исключениями, надо сообщать об ошибке цивилизованно

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.