You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I happened to find out that the refactor doesn't work for my sql wrapper module, so I did some debugging, and I find out that if the file contains the following codes, the parser will results in error like error syntax before query:
case mysql:query(xxx,xxx,xxx) of
.....
After some more debug, I find out that wrangler has a function called wrangler_syntax:query_expr, and i know that there is some syntax called query syntax for Mnesia, so I believe you are making some assertion that a query must be the begin of query syntax ....
This should be a bug because the mysql mode is working fine so the syntax should be ok for erlang compiler.
Here is the mysql driver. You can see it's using query as a main API.
I am trying to create a patch, but the syntax file is a little complicate ...
The text was updated successfully, but these errors were encountered:
Refer to this , query was a legacy keywords for erlang:
Legacy in the grammar
Try to use "query" as an atom in Erlang, e.g. {query, "SELECT * FROM foobar"}. What happens?
syntax error before: ','
This is because 'query' is a reserved word which was reserved for Mnemosyne queries. Never heard of Mnemosyne? That's because it's an archaic way of querying Erlang's built-in database, Mnesia, and has been replaced with Query List Comprehensions (QLC). However, it remains around for backwards compatibility.
You can't use "query" as a function name. You can't tag a tuple with "query". You can't do anything with "query" except invoke a deprecated legacy API which no one uses anymore.
Also refer to erlang's document, query is no longer a reversed word in erlang.
So, removing query as a reserverd word in wrangler_scan.erl fixed my bug.
%reserved_word('query') -> true;
But it's not a final solution for this tool because I believe there are still some people using this syntax, although I haven't seen any.
That's all I can help. Let me know your idea.
johnzeng
changed the title
[buy]syntext error when parsing mysql:query
[bug]syntext error when parsing mysql:query
Aug 12, 2017
I happened to find out that the refactor doesn't work for my sql wrapper module, so I did some debugging, and I find out that if the file contains the following codes, the parser will results in error like
error syntax before query
:After some more debug, I find out that wrangler has a function called
wrangler_syntax:query_expr
, and i know that there is some syntax calledquery syntax
forMnesia
, so I believe you are making some assertion that aquery
must be the begin ofquery syntax
....This should be a bug because the mysql mode is working fine so the syntax should be ok for erlang compiler.
Here is the mysql driver. You can see it's using query as a main API.
I am trying to create a patch, but the syntax file is a little complicate ...
The text was updated successfully, but these errors were encountered: