Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Improve error messages #2

Open
protobird-git opened this issue Jan 30, 2017 · 2 comments
Open

Improve error messages #2

protobird-git opened this issue Jan 30, 2017 · 2 comments
Assignees

Comments

@protobird-git
Copy link
Contributor

for malformed .stl files

mbjorge added a commit that referenced this issue Apr 25, 2017
In anticipation of the parser getting more complex with logic
for improved error messaging, split out the lexer to keep parser.py
cleaner.

Move the lexer and the parser into their own classes. This makes it
easier and cleaner to keep a references to lexer / parser instances
which are needed to do better error messaging when a syntax error comes
up.

Issue: #2
Test: stl/parser_test.py
@mbjorge
Copy link
Contributor

mbjorge commented Apr 25, 2017

High level idea: in p_error, use parser.symstack to look at the stack, and then do some pattern matching to figure out root cause of the parsing error

mbjorge added a commit that referenced this issue Apr 27, 2017
In anticipation of the parser getting more complex with logic
for improved error messaging, split out the lexer to keep parser.py
cleaner.

Move the lexer and the parser into their own classes. This makes it
easier and cleaner to keep a references to lexer / parser instances
which are needed to do better error messaging when a syntax error comes
up.

Issue: #2
Test: stl/parser_test.py
mbjorge added a commit that referenced this issue Apr 27, 2017
In anticipation of the parser getting more complex with logic
for improved error messaging, split out the lexer to keep parser.py
cleaner.

Move the lexer and the parser into their own classes. This makes it
easier and cleaner to keep a references to lexer / parser instances
which are needed to do better error messaging when a syntax error comes
up.

Issue: #2
Test: stl/parser_test.py
mbjorge added a commit that referenced this issue May 24, 2017
As a first step in improved error messaging, setup a system
for pretty printing the parser errors. And make the error formatters
replaceable. This makes it easy to dump out computer readable formats
for use in build systems and human readable formats for manual use.

Issue: #2
Test: Add syntex error to example/example_base.stl and try to parse it.
protobird-git pushed a commit that referenced this issue Jul 11, 2017
* Improve error messaging.

As a first step in improved error messaging, setup a system
for pretty printing the parser errors. And make the error formatters
replaceable. This makes it easy to dump out computer readable formats
for use in build systems and human readable formats for manual use.

Issue: #2
Test: Add syntex error to example/example_base.stl and try to parse it.

* Update parser.py

Fix some bad formatting that happened

* Address comments in error_formatter.py

* Address comments for error_handler.py

* Addressed comments in parser.py

* Fix syntax error in error_formatter.py

* Fix indentation

* Fix copyright year

* Move ErrorInfo and ErrorPosition

* Move ErrorInfo and ErrorPostiion

* add missing import

* remove unused import
@protobird-git
Copy link
Contributor Author

2017 Q3 key result is being tracked by (OKR 2017 Q3) For 5 types of errors, display the line/file of root cause

mbjorge added a commit that referenced this issue Sep 24, 2017
Support clear error messaging for:
  - Missing semicolons
  - Missing quote on string literal
  - Did-You-Mean suggestions for all NameErrors
  - Missing pre_states and post_states
  - Empty pre_states

Issue #2
Issue #20

Test: parser_error_test.py, sprockets_end_to_end_test.py
mbjorge added a commit that referenced this issue Oct 12, 2017
* Add better error messaging for common syntax errors.

Support clear error messaging for:
  - Missing semicolons
  - Missing quote on string literal
  - Did-You-Mean suggestions for all NameErrors
  - Missing pre_states and post_states
  - Empty pre_states

Issue #2
Issue #20

Test: parser_error_test.py, sprockets_end_to_end_test.py

* Make classes for lexer errors and parser errors

* Split parser_error, lexer_error, and test_data into files.

To keep things neat and tidy, split out more things into files.

* More clean up

- Pull out the list of errors into a global
- Put lexer errors first, since they have lower numbers
- Update docstrings to reflect new numbering
- Don't create temp files in end_to_end test
- Update parser_error_test to use the new error objects
- Update travis.yml to run the end-to-end test

* Mock out the test_driver.Visualizer

Could not get `dot` to install from graphviz correctly,
so just mock out the Visualizer, since it's not needed for the
end_to_end test behaviour.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants