From 08e2d74ac0957a1a274be359d50d601a21d3ef0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Sat, 13 Feb 2010 10:19:55 +0100 Subject: parsetools: Replace TABs with spaces The files in the parsetools application are supposed to be indented using spaces only. Remove the stray TABs that somehow have crept in. --- lib/parsetools/include/yeccpre.hrl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/parsetools/include/yeccpre.hrl') diff --git a/lib/parsetools/include/yeccpre.hrl b/lib/parsetools/include/yeccpre.hrl index 2ffa13d6a7..ceaf06f0f7 100644 --- a/lib/parsetools/include/yeccpre.hrl +++ b/lib/parsetools/include/yeccpre.hrl @@ -37,10 +37,10 @@ parse_and_scan({M, F, A}) -> -spec(format_error/1 :: (any()) -> [char() | list()]). format_error(Message) -> case io_lib:deep_char_list(Message) of - true -> - Message; - _ -> - io_lib:write(Message) + true -> + Message; + _ -> + io_lib:write(Message) end. % To be used in grammar files to throw an error message to the parser @@ -85,7 +85,7 @@ yeccpars1([Token | Tokens], Tzr, State, States, Vstack) -> yeccpars1([], {{F, A},_Line}, State, States, Vstack) -> case apply(F, A) of {ok, Tokens, Endline} -> - yeccpars1(Tokens, {{F, A}, Endline}, State, States, Vstack); + yeccpars1(Tokens, {{F, A}, Endline}, State, States, Vstack); {eof, Endline} -> yeccpars1([], {no_func, Endline}, State, States, Vstack); {error, Descriptor, _Endline} -> -- cgit v1.2.3 From 3117c771e07d8bfee5c3141aabfbc3902c65323b Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Fri, 12 Feb 2010 18:06:35 +0100 Subject: parsetools: Modernize types and specs --- lib/parsetools/include/yeccpre.hrl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/parsetools/include/yeccpre.hrl') diff --git a/lib/parsetools/include/yeccpre.hrl b/lib/parsetools/include/yeccpre.hrl index ceaf06f0f7..bbf6c8a232 100644 --- a/lib/parsetools/include/yeccpre.hrl +++ b/lib/parsetools/include/yeccpre.hrl @@ -20,21 +20,20 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The parser generator will insert appropriate declarations before this line.% --type(yecc_ret() :: {'error', _} | {'ok', _}). +-type yecc_ret() :: {'error', _} | {'ok', _}. -spec parse(Tokens :: list()) -> yecc_ret(). parse(Tokens) -> yeccpars0(Tokens, {no_func, no_line}, 0, [], []). --spec(parse_and_scan/1 :: - ({function() | {atom(), atom()}, [_]} | {atom(), atom(), [_]}) -> - yecc_ret()). +-spec parse_and_scan({function() | {atom(), atom()}, [_]} | {atom(), atom(), [_]}) -> + yecc_ret(). parse_and_scan({F, A}) -> % Fun or {M, F} yeccpars0([], {{F, A}, no_line}, 0, [], []); parse_and_scan({M, F, A}) -> yeccpars0([], {{{M, F}, A}, no_line}, 0, [], []). --spec(format_error/1 :: (any()) -> [char() | list()]). +-spec format_error(any()) -> [char() | list()]. format_error(Message) -> case io_lib:deep_char_list(Message) of true -> @@ -45,8 +44,8 @@ format_error(Message) -> % To be used in grammar files to throw an error message to the parser % toplevel. Doesn't have to be exported! --compile({nowarn_unused_function, return_error/2}). --spec(return_error/2 :: (integer(), any()) -> no_return()). +-compile({nowarn_unused_function,{return_error,2}}). +-spec return_error(integer(), any()) -> no_return(). return_error(Line, Message) -> throw({error, {Line, ?MODULE, Message}}). -- cgit v1.2.3 From 152088ba9594105ddee758021e4f5428a5e710cc Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Fri, 12 Feb 2010 18:38:32 +0100 Subject: parsetools: Use %% for comments at the beginning of a line According to the style guidelines (and the Erlang mode for Emacs), comments at the beginning of a line should start with "%%", not "%". --- lib/parsetools/include/yeccpre.hrl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/parsetools/include/yeccpre.hrl') diff --git a/lib/parsetools/include/yeccpre.hrl b/lib/parsetools/include/yeccpre.hrl index bbf6c8a232..252274c553 100644 --- a/lib/parsetools/include/yeccpre.hrl +++ b/lib/parsetools/include/yeccpre.hrl @@ -42,8 +42,8 @@ format_error(Message) -> io_lib:write(Message) end. -% To be used in grammar files to throw an error message to the parser -% toplevel. Doesn't have to be exported! +%% To be used in grammar files to throw an error message to the parser +%% toplevel. Doesn't have to be exported! -compile({nowarn_unused_function,{return_error,2}}). -spec return_error(integer(), any()) -> no_return(). return_error(Line, Message) -> @@ -117,7 +117,7 @@ yeccpars1(State1, State, States, Vstack, Token0, [], {no_func, Line}) -> yeccpars2(State, '$end', [State1 | States], [Token0 | Vstack], yecc_end(Line), [], {no_func, Line}). -% For internal use only. +%% For internal use only. yecc_end({Line,_Column}) -> {'$end', Line}; yecc_end(Line) -> -- cgit v1.2.3