Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"throw" errors instead of trying to "raise" them #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docopt.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ parse_pattern = (source, options) ->
DocoptLanguageError
result = parse_expr tokens, options
if tokens.current() is not null
raise tokens.error 'unexpected ending: ' + tokens.join ' '
throw tokens.error 'unexpected ending: ' + tokens.join ' '
new Required result


Expand Down Expand Up @@ -380,7 +380,7 @@ parse_atom = (tokens, options) ->

result = [new Required parse_expr tokens, options]
if tokens.shift() != ')'
raise tokens.error "Unmatched '('"
throw tokens.error "Unmatched '('"
result
else if token is '['
tokens.shift()
Expand All @@ -390,7 +390,7 @@ parse_atom = (tokens, options) ->
else
result = [new Optional parse_expr tokens, options]
if tokens.shift() != ']'
raise tokens.error "Unmatched '['"
throw tokens.error "Unmatched '['"
result
else if token[0..1] is '--'
if token is '--'
Expand Down
6 changes: 3 additions & 3 deletions docopt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.