diff options
author | Loïc Hoguin <[email protected]> | 2012-11-19 18:31:03 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-01-16 12:46:47 +0100 |
commit | 0dc3a29744bed0b7f483ad72e19773dc0982ea50 (patch) | |
tree | ef36bb22deef8c43f0d876276883acf0e0d02014 /lib | |
parent | fa6771380931c7ded0ad4d36e6cd2554bb932dfc (diff) | |
download | otp-0dc3a29744bed0b7f483ad72e19773dc0982ea50.tar.gz otp-0dc3a29744bed0b7f483ad72e19773dc0982ea50.tar.bz2 otp-0dc3a29744bed0b7f483ad72e19773dc0982ea50.zip |
Remove support for the query keyword and query expressions
Diffstat (limited to 'lib')
-rw-r--r-- | lib/parsetools/test/leex_SUITE.erl | 1 | ||||
-rw-r--r-- | lib/stdlib/examples/erl_id_trans.erl | 5 | ||||
-rw-r--r-- | lib/stdlib/src/epp.erl | 2 | ||||
-rw-r--r-- | lib/stdlib/src/erl_lint.erl | 4 | ||||
-rw-r--r-- | lib/stdlib/src/erl_parse.yrl | 8 | ||||
-rw-r--r-- | lib/stdlib/src/erl_pp.erl | 2 | ||||
-rw-r--r-- | lib/stdlib/src/erl_scan.erl | 1 | ||||
-rw-r--r-- | lib/stdlib/test/erl_pp_SUITE.erl | 22 | ||||
-rw-r--r-- | lib/stdlib/test/erl_scan_SUITE.erl | 2 | ||||
-rw-r--r-- | lib/syntax_tools/src/erl_prettypr.erl | 7 | ||||
-rw-r--r-- | lib/syntax_tools/src/erl_syntax.erl | 55 | ||||
-rw-r--r-- | lib/wx/examples/demo/demo_html_tagger.erl | 1 |
12 files changed, 5 insertions, 105 deletions
diff --git a/lib/parsetools/test/leex_SUITE.erl b/lib/parsetools/test/leex_SUITE.erl index 4a0f70ba71..9d591c0d05 100644 --- a/lib/parsetools/test/leex_SUITE.erl +++ b/lib/parsetools/test/leex_SUITE.erl @@ -649,7 +649,6 @@ reserved_word('fun') -> true; reserved_word('if') -> true; reserved_word('let') -> true; reserved_word('of') -> true; -reserved_word('query') -> true; reserved_word('receive') -> true; reserved_word('when') -> true; reserved_word('bnot') -> true; diff --git a/lib/stdlib/examples/erl_id_trans.erl b/lib/stdlib/examples/erl_id_trans.erl index 34c6ecc394..51def8c8e1 100644 --- a/lib/stdlib/examples/erl_id_trans.erl +++ b/lib/stdlib/examples/erl_id_trans.erl @@ -153,7 +153,6 @@ pattern({record,Line,Name,Pfs0}) -> pattern({record_index,Line,Name,Field0}) -> Field1 = pattern(Field0), {record_index,Line,Name,Field1}; -%% record_field occurs in query expressions pattern({record_field,Line,Rec0,Name,Field0}) -> Rec1 = expr(Rec0), Field1 = expr(Field0), @@ -431,10 +430,6 @@ expr({'catch',Line,E0}) -> %% No new variables added. E1 = expr(E0), {'catch',Line,E1}; -expr({'query', Line, E0}) -> - %% lc expression - E = expr(E0), - {'query', Line, E}; expr({match,Line,P0,E0}) -> E1 = expr(E0), P1 = pattern(P0), diff --git a/lib/stdlib/src/epp.erl b/lib/stdlib/src/epp.erl index a0f7660ecf..ebabf8d700 100644 --- a/lib/stdlib/src/epp.erl +++ b/lib/stdlib/src/epp.erl @@ -1224,8 +1224,6 @@ macro_arg([{'try',Lr}|Toks], E, Arg) -> macro_arg(Toks, ['end'|E], [{'try',Lr}|Arg]); macro_arg([{'cond',Lr}|Toks], E, Arg) -> macro_arg(Toks, ['end'|E], [{'cond',Lr}|Arg]); -macro_arg([{'query',Lr}|Toks], E, Arg) -> - macro_arg(Toks, ['end'|E], [{'query',Lr}|Arg]); macro_arg([{Rb,Lrb}|Toks], [Rb|E], Arg) -> %Found matching close macro_arg(Toks, E, [{Rb,Lrb}|Arg]); macro_arg([T|Toks], E, Arg) -> diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl index d24e2fff44..8fd45c3fe2 100644 --- a/lib/stdlib/src/erl_lint.erl +++ b/lib/stdlib/src/erl_lint.erl @@ -2205,9 +2205,7 @@ expr({op,_Line,_Op,L,R}, Vt, St) -> expr_list([L,R], Vt, St); %They see the same variables %% The following are not allowed to occur anywhere! expr({remote,Line,_M,_F}, _Vt, St) -> - {[],add_error(Line, illegal_expr, St)}; -expr({'query',Line,_Q}, _Vt, St) -> - {[],add_error(Line, {mnemosyne,"query"}, St)}. + {[],add_error(Line, illegal_expr, St)}. %% expr_list(Expressions, Variables, State) -> %% {UsedVarTable,State} diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl index 002abc11e8..8316462989 100644 --- a/lib/stdlib/src/erl_parse.yrl +++ b/lib/stdlib/src/erl_parse.yrl @@ -36,7 +36,7 @@ tuple record_expr record_tuple record_field record_fields if_expr if_clause if_clauses case_expr cr_clause cr_clauses receive_expr fun_expr fun_clause fun_clauses atom_or_var integer_or_var -try_expr try_catch try_clause try_clauses query_expr +try_expr try_catch try_clause try_clauses function_call argument_list exprs guard atomic strings @@ -54,7 +54,7 @@ char integer float atom string var '(' ')' ',' '->' ':-' '{' '}' '[' ']' '|' '||' '<-' ';' ':' '#' '.' 'after' 'begin' 'case' 'try' 'catch' 'end' 'fun' 'if' 'of' 'receive' 'when' -'andalso' 'orelse' 'query' +'andalso' 'orelse' 'bnot' 'not' '*' '/' 'div' 'rem' 'band' 'and' '+' '-' 'bor' 'bxor' 'bsl' 'bsr' 'or' 'xor' @@ -272,7 +272,6 @@ expr_max -> case_expr : '$1'. expr_max -> receive_expr : '$1'. expr_max -> fun_expr : '$1'. expr_max -> try_expr : '$1'. -expr_max -> query_expr : '$1'. list -> '[' ']' : {nil,?line('$1')}. @@ -432,9 +431,6 @@ try_clause -> var ':' expr clause_guard clause_body : L = ?line('$1'), {clause,L,[{tuple,L,['$1','$3',{var,L,'_'}]}],'$4','$5'}. -query_expr -> 'query' list_comprehension 'end' : - {'query',?line('$1'),'$2'}. - argument_list -> '(' ')' : {[],?line('$1')}. argument_list -> '(' exprs ')' : {'$2',?line('$1')}. diff --git a/lib/stdlib/src/erl_pp.erl b/lib/stdlib/src/erl_pp.erl index 0383ce6839..0e1156075a 100644 --- a/lib/stdlib/src/erl_pp.erl +++ b/lib/stdlib/src/erl_pp.erl @@ -510,8 +510,6 @@ lexpr({'fun',_,{clauses,Cs}}, _Prec, Opts) -> lexpr({'fun',_,{clauses,Cs},Extra}, _Prec, Opts) -> {force_nl,fun_info(Extra), {list,[{first,'fun',fun_clauses(Cs, Opts)},'end']}}; -lexpr({'query',_,Lc}, _Prec, Opts) -> - {list,[{step,leaf("query"),lexpr(Lc, 0, Opts)},'end']}; lexpr({call,_,{remote,_,{atom,_,M},{atom,_,F}=N}=Name,Args}, Prec, Opts) -> case erl_internal:bif(M, F, length(Args)) of true -> diff --git a/lib/stdlib/src/erl_scan.erl b/lib/stdlib/src/erl_scan.erl index e5bb287c45..bc0eaf015d 100644 --- a/lib/stdlib/src/erl_scan.erl +++ b/lib/stdlib/src/erl_scan.erl @@ -1404,7 +1404,6 @@ reserved_word('fun') -> true; reserved_word('if') -> true; reserved_word('let') -> true; reserved_word('of') -> true; -reserved_word('query') -> true; reserved_word('receive') -> true; reserved_word('when') -> true; reserved_word('bnot') -> true; diff --git a/lib/stdlib/test/erl_pp_SUITE.erl b/lib/stdlib/test/erl_pp_SUITE.erl index db416b03b0..37be61d665 100644 --- a/lib/stdlib/test/erl_pp_SUITE.erl +++ b/lib/stdlib/test/erl_pp_SUITE.erl @@ -537,29 +537,9 @@ messages(Config) when is_list(Config) -> ?line true = "\n" =:= lists:flatten(erl_pp:form({eof,0})), ok. -old_mnemosyne_syntax(suite) -> - []; old_mnemosyne_syntax(Config) when is_list(Config) -> - %% Since we have kept the 'query' syntax and ':-' token, + %% Since we have kept the ':-' token, %% better test that we can pretty print it. - Q = {'query',6, - {lc,6, - {var,6,'X'}, - [{generate,6, - {var,6,'X'}, - {call,6,{atom,6,table},[{atom,6,tab}]}}, - {match,7, - {record_field,7,{var,7,'X'},{atom,7,foo}}, - {atom,7,bar}}]}}, - ?line "query\n" - " [ \n" % extra space... - " X ||\n" - " X <- table(tab),\n" - " X.foo = bar\n" - " ]\n" - "end" = - lists:flatten(erl_pp:expr(Q)), - R = {rule,12,sales,2, [{clause,12, [{var,12,'E'},{atom,12,employee}], diff --git a/lib/stdlib/test/erl_scan_SUITE.erl b/lib/stdlib/test/erl_scan_SUITE.erl index 34e1b99abe..9a6b2f8f34 100644 --- a/lib/stdlib/test/erl_scan_SUITE.erl +++ b/lib/stdlib/test/erl_scan_SUITE.erl @@ -197,7 +197,7 @@ otp_7810(Config) when is_list(Config) -> reserved_words() -> L = ['after', 'begin', 'case', 'try', 'cond', 'catch', 'andalso', 'orelse', 'end', 'fun', 'if', 'let', 'of', - 'query', 'receive', 'when', 'bnot', 'not', 'div', + 'receive', 'when', 'bnot', 'not', 'div', 'rem', 'band', 'and', 'bor', 'bxor', 'bsl', 'bsr', 'or', 'xor'], [begin diff --git a/lib/syntax_tools/src/erl_prettypr.erl b/lib/syntax_tools/src/erl_prettypr.erl index 1a55a5e71c..1ffcf31134 100644 --- a/lib/syntax_tools/src/erl_prettypr.erl +++ b/lib/syntax_tools/src/erl_prettypr.erl @@ -813,13 +813,6 @@ lay_2(Node, Ctxt) -> reset_prec(Ctxt)), lay_parentheses(D, Ctxt); - query_expr -> - Ctxt1 = reset_prec(Ctxt), - D = lay(erl_syntax:query_expr_body(Node), Ctxt1), - sep([text("query"), - nest(Ctxt1#ctxt.sub_indent, D), - text("end")]); - receive_expr -> Ctxt1 = reset_prec(Ctxt), D1 = lay_clauses(erl_syntax:receive_expr_clauses(Node), diff --git a/lib/syntax_tools/src/erl_syntax.erl b/lib/syntax_tools/src/erl_syntax.erl index f7420030c3..41a1708925 100644 --- a/lib/syntax_tools/src/erl_syntax.erl +++ b/lib/syntax_tools/src/erl_syntax.erl @@ -235,8 +235,6 @@ prefix_expr/2, prefix_expr_argument/1, prefix_expr_operator/1, - query_expr/1, - query_expr_body/1, receive_expr/1, receive_expr/3, receive_expr_action/1, @@ -449,7 +447,6 @@ %% <td>parentheses</td> %% <td>prefix_expr</td> %% </tr><tr> -%% <td>query_expr</td> %% <td>receive_expr</td> %% <td>record_access</td> %% </tr><tr> @@ -513,7 +510,6 @@ %% @see operator/1 %% @see parentheses/1 %% @see prefix_expr/2 -%% @see query_expr/1 %% @see receive_expr/3 %% @see record_access/3 %% @see record_expr/2 @@ -578,7 +574,6 @@ type(Node) -> {match, _, _, _} -> match_expr; {op, _, _, _, _} -> infix_expr; {op, _, _, _} -> prefix_expr; - {'query', _, _} -> query_expr; {record, _, _, _, _} -> record_expr; {record, _, _, _} -> record_expr; {record_field, _, _, _, _} -> record_access; @@ -4097,7 +4092,6 @@ record_access(Argument, Field) -> %% @see record_access_type/1 %% @see record_access_field/1 %% @see record_expr/3 -%% @see query_expr/1 -record(record_access, {argument :: syntaxTree(), type :: 'none' | syntaxTree(), @@ -4574,50 +4568,6 @@ binary_comp_body(Node) -> %% ===================================================================== -%% @doc Creates an abstract Mnemosyne query expression. The result -%% represents "<code>query <em>Body</em> end</code>". -%% -%% @see query_expr_body/1 -%% @see record_access/2 -%% @see rule/2 - -%% type(Node) = query_expr -%% data(Node) = syntaxTree() -%% -%% `erl_parse' representation: -%% -%% {'query', Pos, Body} -%% -%% Body = erl_parse() - --spec query_expr(syntaxTree()) -> syntaxTree(). - -query_expr(Body) -> - tree(query_expr, Body). - -revert_query_expr(Node) -> - Pos = get_pos(Node), - Body = list_comp_body(Node), - {'query', Pos, Body}. - - -%% ===================================================================== -%% @doc Returns the body subtree of a `query_expr' node. -%% -%% @see query_expr/1 - --spec query_expr_body(syntaxTree()) -> syntaxTree(). - -query_expr_body(Node) -> - case unwrap(Node) of - {'query', _, Body} -> - Body; - Node1 -> - data(Node1) - end. - - -%% ===================================================================== %% @doc Creates an abstract Mnemosyne rule. If `Clauses' is %% `[C1, ..., Cn]', the results represents %% "<code><em>Name</em> <em>C1</em>; ...; <em>Name</em> @@ -6041,8 +5991,6 @@ revert_root(Node) -> revert_parentheses(Node); prefix_expr -> revert_prefix_expr(Node); - query_expr -> - revert_query_expr(Node); receive_expr -> revert_receive_expr(Node); record_access -> @@ -6283,8 +6231,6 @@ subtrees(T) -> prefix_expr -> [[prefix_expr_operator(T)], [prefix_expr_argument(T)]]; - query_expr -> - [[query_expr_body(T)]]; receive_expr -> case receive_expr_timeout(T) of none -> @@ -6413,7 +6359,6 @@ make_tree(match_expr, [[P], [E]]) -> match_expr(P, E); make_tree(module_qualifier, [[M], [N]]) -> module_qualifier(M, N); make_tree(parentheses, [[E]]) -> parentheses(E); make_tree(prefix_expr, [[F], [A]]) -> prefix_expr(F, A); -make_tree(query_expr, [[B]]) -> query_expr(B); make_tree(receive_expr, [C]) -> receive_expr(C); make_tree(receive_expr, [C, [E], A]) -> receive_expr(C, E, A); make_tree(record_access, [[E], [F]]) -> diff --git a/lib/wx/examples/demo/demo_html_tagger.erl b/lib/wx/examples/demo/demo_html_tagger.erl index 243e5d659f..46bfe73676 100644 --- a/lib/wx/examples/demo/demo_html_tagger.erl +++ b/lib/wx/examples/demo/demo_html_tagger.erl @@ -485,7 +485,6 @@ is_keyword('not') -> true; is_keyword('of' ) -> true; is_keyword('or' ) -> true; is_keyword('orelse' ) -> true; -is_keyword('query' ) -> true; is_keyword('receive' ) -> true; is_keyword('rem' ) -> true; is_keyword('spec') -> true; |