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

Add support of waiting pattern in case not closed brackets #168

Closed
snuyanzin opened this issue Oct 8, 2018 · 2 comments
Closed

Add support of waiting pattern in case not closed brackets #168

snuyanzin opened this issue Oct 8, 2018 · 2 comments

Comments

@snuyanzin
Copy link
Collaborator

snuyanzin commented Oct 8, 2018

There is an update of waiting pattern for quotes and comments implemented at #129.
It also makes sense to have support for non-closed (not quoted and not commented) brackets ) and may be ] (could be used in MS SQL)

@snuyanzin
Copy link
Collaborator Author

snuyanzin commented Oct 10, 2018

The implementation detects non-closed round/square brackets for instance

sqlline> select count(
. . . )>

it also could detect extra brackets like

sqlline> select count)2)
extra ')'>

The whole table for waiting patterns now looks like

Prompt Meaning
sqlline> Ready for a new query
semicolon> Waiting for next line of multiple-line query, waiting for completion of query with semicolon (;)
quote> Waiting for next line, waiting for completion of a string that began with a single quote (')
dquote> Waiting for next line, waiting for completion of a string that began with a double quote (")
*/> Waiting for next line, waiting for completion of a multiline comment that began with /*
)> Waiting for next line, waiting for completion of a string that began with a round bracket (
]> Waiting for next line, waiting for completion of a string that began with a square bracket [
extra ')'> There is an extra round bracket ) which is not opened with (
extra ']'> There is an extra square bracket ] which is not opened with [

@julianhyde
Copy link
Owner

Fixed in d3802ae, PR #159; thanks @snuyanzin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants