This repository was archived by the owner on Aug 31, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Throw parse error when unary function has no params
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
2727
2828#include " exec.h"
2929#include " param.h"
30+ #include " scriptpt.h"
3031
3132// //////////////////////////////////////////////////////////////////////////////
3233
@@ -93,7 +94,7 @@ class MCUnaryFunctionCtxt: public MCUnaryFunction
9394
9495 virtual Parse_stat parse (MCScriptPoint &sp, Boolean the)
9596 {
96- if (get1param (sp, &m_expression, the) != PS_NORMAL)
97+ if (sp. is_eol () || get1param (sp, &m_expression, the) != PS_NORMAL)
9798 {
9899 MCperror -> add (ParseError, sp);
99100 return PS_ERROR;
Original file line number Diff line number Diff line change 1+ %% Copyright (C) 2018 LiveCode Ltd.
2+ %%
3+ %% This file is part of LiveCode.
4+ %%
5+ %% LiveCode is free software; you can redistribute it and/or modify it under
6+ %% the terms of the GNU General Public License v3 as published by the Free
7+ %% Software Foundation.
8+ %%
9+ %% LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY
10+ %% WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+ %% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+ %% for more details.
13+ %%
14+ %% You should have received a copy of the GNU General Public License
15+ %% along with LiveCode. If not see <http://www.gnu.org/licenses/>.
16+
17+ %TEST UnaryFunctionNoParams
18+ on parse_test
19+ get the fontlanguage %{AFTER_FUNCTION}
20+ end parse_test
21+ %EXPECT PASS
22+ %ERROR PE_FONTNAMES_BADPARAM AT AFTER_FUNCTION
23+ %ENDTEST
You can’t perform that action at this time.
0 commit comments