Wrong thread...
On 09/10/2014 03:04 AM, Kyotaro HORIGUCHI wrote:
Hmm. Sorry, I misunderstood the specification.
You approach that coloring tokens seems right, but you have
broken the parse logic by adding your code.
Other than the mistakes others pointed, I found that
- non-SQL-ident like tokens are ignored by their token style,
quoted or not, so the following line works.
| "local" All aLL trust
I suppose this is not what you intended. This is because you have
igonred the attribute of a token when comparing it as
non-SQL-ident tokens.
- '+' at the head of the sequence '+"' is treated as the first
character of the *quoted* string. e.g. +"hoge" is tokenized as
"+hoge":special_quoted.
I found this is what intended. This should be documented as
comments.
|2) users and user-groups only requires special handling and behavior as follows
| Normal user :
| A. unquoted ( USER ) will be treated as user ( downcase ).
| B. quoted ( "USeR" ) will be treated as USeR (case-sensitive).
| C. quoted ( "+USER" ) will be treated as normal user +USER (i.e. will
not be considered as user-group) and case-sensitive as string is quoted.
This seems confising with the B below. This seems should be
rearranged.
| User Group :
| A. unquoted ( +USERGROUP ) will be treated as +usergruop ( downcase ).
| B. plus quoted ( +"UserGROUP" ) will be treated as +UserGROUP
(case-sensitive).
This is why you simply continued processing for '+"' without
discarding and skipping the '+', and not setting in_quote so the
following parser code works as it is not intended. You should
understand what the original code does and insert or modify
logics not braeking the assumptions.
regards,
--
- Heikki
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers