Skip to content

Commit 21f5fe0

Browse files
committed
移除异常得使用
1 parent 5c323d6 commit 21f5fe0

File tree

5 files changed

+7
-20
lines changed

5 files changed

+7
-20
lines changed

LuaParser/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ target_sources(LuaParser PUBLIC
1414
${LuaCodeStyle_SOURCE_DIR}/include/LuaParser/LuaToken.h
1515
${LuaCodeStyle_SOURCE_DIR}/include/LuaParser/LuaTokenType.h
1616
${LuaCodeStyle_SOURCE_DIR}/include/LuaParser/LuaTokenParser.h
17-
${LuaCodeStyle_SOURCE_DIR}/include/LuaParser/LuaParseException.h
1817
${LuaCodeStyle_SOURCE_DIR}/include/LuaParser/LuaParser.h
1918

2019
${LuaCodeStyle_SOURCE_DIR}/include/LuaParser/LuaAstNode.h

LuaParser/src/LuaAstNode.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "LuaParser/LuaAstNode.h"
2-
#include "LuaParser/LuaParseException.h"
32

43
LuaAstNode::LuaAstNode(LuaAstNodeType type, const char* source)
54
: _type(type),
@@ -43,7 +42,8 @@ void LuaAstNode::AddChild(std::shared_ptr<LuaAstNode> child)
4342

4443
if (child->_source != _source)
4544
{
46-
throw LuaParserException("child source not match parent source");
45+
return;
46+
// throw LuaParserException("child source not match parent source");
4747
}
4848

4949
if (_textRange.StartOffset == 0 && _textRange.EndOffset == 0)
@@ -134,7 +134,8 @@ void LuaAstNode::addChildBefore(int index, std::shared_ptr<LuaAstNode> child)
134134
{
135135
if (child->_source != _source)
136136
{
137-
throw LuaParserException("child source not match parent source");
137+
return;
138+
// throw LuaParserException("child source not match parent source");
138139
}
139140

140141
if (_textRange.StartOffset == 0 && _textRange.EndOffset == 0)

LuaParser/src/LuaTokenParser.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,9 @@ void LuaTokenParser::incLinenumber()
665665

666666
if (++_linenumber >= std::numeric_limits<int>::max())
667667
{
668-
throw LuaParserException("chunk has too many lines");
668+
return;
669+
// luaError("")
670+
// throw LuaParserException("chunk has too many lines");
669671
}
670672

671673
_lineOffsetVec.push_back(static_cast<int>(_currentParseIndex));

include/LuaParser/LuaParseException.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

include/LuaParser/LuaTokenParser.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "LuaToken.h"
1010
#include "LuaTokenType.h"
11-
#include "LuaParseException.h"
1211

1312
/*
1413
* token 解析来自于lua 源代码,实现上非常接近但细节处并不相同

0 commit comments

Comments
 (0)