Skip to content

Commit 4f92aa7

Browse files
committed
Merge branch 'refactor/tokenizer' into autobuild/tokenizer
2 parents 86b87b7 + 7d8dc2d commit 4f92aa7

File tree

13 files changed

+549
-393
lines changed

13 files changed

+549
-393
lines changed

source/base/configbase.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,12 +1051,29 @@ static_assert(
10511051
#define POV_BACKSLASH_IS_PATH_SEPARATOR 0
10521052
#endif
10531053

1054+
/// @def POV_ASSERT
1055+
/// Assert a condition that should hold true by design.
1056+
/// In debug builds, this macro evaluates the specified expression, and halts execution if the
1057+
/// expression does not hold true.
1058+
/// In release builds, this macro evaluates to an empty statement.
10541059
#if POV_DEBUG
10551060
#define POV_ASSERT(expr) POV_ASSERT_HARD(expr)
10561061
#else
10571062
#define POV_ASSERT(expr) POV_ASSERT_DISABLE(expr)
10581063
#endif
10591064

1065+
/// @def POV_EXPERIMENTAL_ASSERT
1066+
/// Assert a condition that is expected to hold true by current understanding of the code.
1067+
/// This macro evaluates the specified expression, and halts execution (in debug builds) or throws
1068+
/// an exception (in release builds) if the expression does not hold true.
1069+
/// @attention
1070+
/// This macro is intended for special builds only, and should _never_ be used in mainline versions!
1071+
#if POV_DEBUG
1072+
#define POV_EXPERIMENTAL_ASSERT(expr) POV_ASSERT_HARD(expr)
1073+
#else
1074+
#define POV_EXPERIMENTAL_ASSERT(expr) POV_ASSERT_SOFT(expr)
1075+
#endif
1076+
10601077
#if POV_COLOURSPACE_DEBUG
10611078
#define POV_COLOURSPACE_ASSERT(expr) POV_ASSERT_HARD(expr)
10621079
#else

source/base/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
/// where `N` is a serial number starting at 1 in each phase, `TIME` is the number of minutes
101101
/// since 2000-01-01 00:00, and `FEATURE` is an arbitrary alphanumeric moniker for a particular
102102
/// experimental feature.
103-
#define POV_RAY_PRERELEASE "x.tokenizer.9945666"
103+
#define POV_RAY_PRERELEASE "x.tokenizer.9960461"
104104

105105
#if defined(DOXYGEN) && !defined(POV_RAY_PRERELEASE)
106106
// Work around doxygen being unable to document undefined macros.

source/core/material/blendmap.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// @parblock
99
///
1010
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
11-
/// Copyright 1991-2017 Persistence of Vision Raytracer Pty. Ltd.
11+
/// Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd.
1212
///
1313
/// POV-Ray is free software: you can redistribute it and/or modify
1414
/// it under the terms of the GNU Affero General Public License as
@@ -159,17 +159,17 @@ TextureBlendMapPtr Create_Blend_Map<TextureBlendMap> (BlendMapTypeId type)
159159
******************************************************************************/
160160

161161
template<typename MAP_T>
162-
shared_ptr<MAP_T> Copy_Blend_Map (shared_ptr<MAP_T>& Old)
162+
shared_ptr<MAP_T> Copy_Blend_Map (const shared_ptr<MAP_T>& Old)
163163
{
164164
return shared_ptr<MAP_T>(Old);
165165
}
166166

167-
template ColourBlendMapPtr Copy_Blend_Map (ColourBlendMapPtr& Old);
168-
template PigmentBlendMapPtr Copy_Blend_Map (PigmentBlendMapPtr& Old);
169-
template GenericNormalBlendMapPtr Copy_Blend_Map (GenericNormalBlendMapPtr& Old);
170-
template SlopeBlendMapPtr Copy_Blend_Map (SlopeBlendMapPtr& Old);
171-
template NormalBlendMapPtr Copy_Blend_Map (NormalBlendMapPtr& Old);
172-
template TextureBlendMapPtr Copy_Blend_Map (TextureBlendMapPtr& Old);
167+
template ColourBlendMapPtr Copy_Blend_Map (const ColourBlendMapPtr& Old);
168+
template PigmentBlendMapPtr Copy_Blend_Map (const PigmentBlendMapPtr& Old);
169+
template GenericNormalBlendMapPtr Copy_Blend_Map (const GenericNormalBlendMapPtr& Old);
170+
template SlopeBlendMapPtr Copy_Blend_Map (const SlopeBlendMapPtr& Old);
171+
template NormalBlendMapPtr Copy_Blend_Map (const NormalBlendMapPtr& Old);
172+
template TextureBlendMapPtr Copy_Blend_Map (const TextureBlendMapPtr& Old);
173173

174174

175175
/*****************************************************************************

source/core/material/blendmap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/// @parblock
1111
///
1212
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
13-
/// Copyright 1991-2017 Persistence of Vision Raytracer Pty. Ltd.
13+
/// Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd.
1414
///
1515
/// POV-Ray is free software: you can redistribute it and/or modify
1616
/// it under the terms of the GNU Affero General Public License as
@@ -102,7 +102,7 @@ template<typename MAP_T>
102102
shared_ptr<MAP_T> Create_Blend_Map (BlendMapTypeId type);
103103

104104
template<typename MAP_T>
105-
shared_ptr<MAP_T> Copy_Blend_Map (shared_ptr<MAP_T>& Old);
105+
shared_ptr<MAP_T> Copy_Blend_Map (const shared_ptr<MAP_T>& Old);
106106

107107
/// @}
108108
///

source/parser/fncode.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ FNCode::FNCode(Parser *pa, FunctionCode *f, bool is_local, const char *n)
120120
}
121121

122122
if (n != nullptr)
123-
function->sourceInfo.name = POV_STRDUP(n);
123+
function->sourceInfo.name = n;
124124
else
125-
function->sourceInfo.name = POV_STRDUP("");
126-
function->sourceInfo.fileName = parser->UCS2_strdup(parser->mToken.sourceFile->Name());
127-
function->sourceInfo.position = parser->mToken.raw.lexeme.position;
125+
function->sourceInfo.name = "";
126+
function->sourceInfo.fileName = parser->CurrentFileName();
127+
function->sourceInfo.position = parser->CurrentFilePosition();
128128
function->flags = 0;
129129
function->private_copy_method = nullptr;
130130
function->private_destroy_method = nullptr;
@@ -166,20 +166,20 @@ FNCode::FNCode(Parser *pa, FunctionCode *f, bool is_local, const char *n)
166166
void FNCode::Parameter()
167167
{
168168
parser->Get_Token();
169-
if(parser->mToken.Token_Id == LEFT_PAREN_TOKEN)
169+
if(parser->CurrentTokenId() == LEFT_PAREN_TOKEN)
170170
{
171171
for(function->parameter_cnt = 0;
172-
((parser->mToken.Token_Id != RIGHT_PAREN_TOKEN) || (function->parameter_cnt == 0)) && (function->parameter_cnt < MAX_FUNCTION_PARAMETER_LIST);
172+
((parser->CurrentTokenId() != RIGHT_PAREN_TOKEN) || (function->parameter_cnt == 0)) && (function->parameter_cnt < MAX_FUNCTION_PARAMETER_LIST);
173173
function->parameter_cnt++)
174174
{
175175
parser->Get_Token();
176176

177-
if((parser->mToken.Function_Id != IDENTIFIER_TOKEN) && (parser->mToken.Function_Id != X_TOKEN) &&
178-
(parser->mToken.Function_Id != Y_TOKEN) && (parser->mToken.Function_Id != Z_TOKEN) &&
179-
(parser->mToken.Function_Id != U_TOKEN) && (parser->mToken.Function_Id != V_TOKEN))
177+
if((parser->CurrentTokenFunctionId() != IDENTIFIER_TOKEN) && (parser->CurrentTokenFunctionId() != X_TOKEN) &&
178+
(parser->CurrentTokenFunctionId() != Y_TOKEN) && (parser->CurrentTokenFunctionId() != Z_TOKEN) &&
179+
(parser->CurrentTokenFunctionId() != U_TOKEN) && (parser->CurrentTokenFunctionId() != V_TOKEN))
180180
parser->Expectation_Error("parameter identifier");
181181

182-
function->parameter[function->parameter_cnt] = POV_STRDUP(parser->mToken.raw.lexeme.text.c_str());
182+
function->parameter[function->parameter_cnt] = POV_STRDUP(parser->CurrentTokenText().c_str());
183183

184184
parser->Parse_Comma();
185185
}

0 commit comments

Comments
 (0)