{"action":"created","issue":{"url":"https://api.github.com/repos/Drakulix/zwreec/issues/163","labels_url":"https://api.github.com/repos/Drakulix/zwreec/issues/163/labels{/name}","comments_url":"https://api.github.com/repos/Drakulix/zwreec/issues/163/comments","events_url":"https://api.github.com/repos/Drakulix/zwreec/issues/163/events","html_url":"https://github.com/Drakulix/zwreec/pull/163","id":90156408,"number":163,"title":"Option to not panic during lexical analysis","user":{"login":"laerador","id":1162123,"avatar_url":"https://avatars.githubusercontent.com/u/1162123?v=3","gravatar_id":"","url":"https://api.github.com/users/laerador","html_url":"https://github.com/laerador","followers_url":"https://api.github.com/users/laerador/followers","following_url":"https://api.github.com/users/laerador/following{/other_user}","gists_url":"https://api.github.com/users/laerador/gists{/gist_id}","starred_url":"https://api.github.com/users/laerador/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laerador/subscriptions","organizations_url":"https://api.github.com/users/laerador/orgs","repos_url":"https://api.github.com/users/laerador/repos","events_url":"https://api.github.com/users/laerador/events{/privacy}","received_events_url":"https://api.github.com/users/laerador/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-06-22T17:10:36Z","updated_at":"2015-06-22T19:47:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Drakulix/zwreec/pulls/163","html_url":"https://github.com/Drakulix/zwreec/pull/163","diff_url":"https://github.com/Drakulix/zwreec/pull/163.diff","patch_url":"https://github.com/Drakulix/zwreec/pull/163.patch"},"body":"This PR introduces a new fake Token `TokError{location, message}` to record Errors that happened during the lexical analysis. The `FilteringScan` can then use this `TokError` to actually create an error or panic, depending on the config option `cfg.force`. This option is set by supplying `-f` on the command line. \r\n\r\n`bad_expression_panic()` and `bad_argument_panic()` have been rewritten to provide an `TokError` instead of directly panic-ing. \r\n\r\nTo make the config available inside the `FilteringScan`, it has been added to the `ScanState` struct. The same approach could be used by the parser.\r\n\r\n`LexerError` is still not used.\r\n\r\nSome questions remain: Are there more errors, that are thrown by the lexer besides `bad_expression`/`bad_argument`? *Can* there be more? Is there a way to pass (more) arguments to TweeLexer?\r\n\r\nRegarding the error-handling inside the Parser: The Parser could also do some intelligent error handling, instead of throwing a panic. But to do that, it might need the ability to remove things from the AST. For example: An If-Statement without and Endif could be compiled by removing the entire If-Statement from the AST. But this does require additional logic. \r\n\r\nDepending of what was actually required by that Issue, this *might* close #99."},"comment":{"url":"https://api.github.com/repos/Drakulix/zwreec/issues/comments/114235773","html_url":"https://github.com/Drakulix/zwreec/pull/163#issuecomment-114235773","issue_url":"https://api.github.com/repos/Drakulix/zwreec/issues/163","id":114235773,"user":{"login":"laerador","id":1162123,"avatar_url":"https://avatars.githubusercontent.com/u/1162123?v=3","gravatar_id":"","url":"https://api.github.com/users/laerador","html_url":"https://github.com/laerador","followers_url":"https://api.github.com/users/laerador/followers","following_url":"https://api.github.com/users/laerador/following{/other_user}","gists_url":"https://api.github.com/users/laerador/gists{/gist_id}","starred_url":"https://api.github.com/users/laerador/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laerador/subscriptions","organizations_url":"https://api.github.com/users/laerador/orgs","repos_url":"https://api.github.com/users/laerador/repos","events_url":"https://api.github.com/users/laerador/events{/privacy}","received_events_url":"https://api.github.com/users/laerador/received_events","type":"User","site_admin":false},"created_at":"2015-06-22T19:47:31Z","updated_at":"2015-06-22T19:47:31Z","body":"Ich hab jetzt nochmal eine kleine, kosmetische Änderung gemacht. Ob du dir jetzt die Mühe machen willst, da LexerError zu verwenden musst du wissen, ich glaube nicht, dass das im Lexer sinnvoll ist."}}