Compare commits

...

37 Commits

Author SHA1 Message Date
jasder 6ea283bf56 Add sadads 2021-12-01 10:55:13 +08:00
jasder 58ef8f982c Add dsfsfsdf 2021-12-01 10:54:34 +08:00
jasder 9dec2f1756 Add sdfs.html 2021-12-01 10:52:57 +08:00
jasder 041c4872f4 Update dsjdjsfjk.js 2021-11-01 12:00:32 +08:00
jasder 6e3aceb580 Update dsjdjsfjk.js 2021-11-01 11:49:42 +08:00
jasder 1616316694 Update dsjdjsfjk.js 2021-11-01 11:40:39 +08:00
jasder 59fb219eca Add dsjdjsfjk.js 2021-11-01 10:35:52 +08:00
jasder 96b2c56d39 test111
测试 测试合并后是否会刷新评论列表
2021-10-13 15:15:44 +08:00
jasder 2b797f1833 测试
测试合并后是否会刷新评论列表
2021-10-13 15:14:30 +08:00
jasder 574f5f280b Merge pull request 'test' (#8) from align-js-runtime-with-java-runtime into master 2021-10-11 15:33:00 +08:00
Terence Parr 6255420440
Merge pull request #3164 from bigerl/patch-utfcpp-build
Patch utfcpp build
2021-04-27 08:58:08 -07:00
Alexander Bigerl d5e8ada699 add bigerl to contributors.txt 2021-04-24 18:55:54 +02:00
Alexander Bigerl 49cf9d4fe2 C++ runtime: disable build of dep utf8cpp tests and samples 2021-04-24 18:55:46 +02:00
Terence Parr e404d26f61
Merge pull request #2849 from mattpaletta/master
Added templated move support for antlrcpp::Any
2021-04-12 08:27:34 -07:00
Matthew Paletta f901c8d39a Merge branch 'master' of https://github.com/antlr/antlr4 2021-04-09 19:12:33 +01:00
Terence Parr 478e46409e
Merge pull request #3149 from mike-lischke/revert-3040-patch-1
Revert "Cpp target: No building tests/samples for external utfcpp"
2021-04-09 09:30:25 -07:00
Mike Lischke 4b4ca4058a
Revert "Cpp target: No building tests/samples for external utfcpp" 2021-04-09 14:18:25 +02:00
Terence Parr 697074c3e9
Merge branch 'master' into master 2021-04-08 09:18:40 -07:00
Terence Parr b71f6894c7
Merge pull request #3040 from bigerl/patch-1
Cpp target: No building tests/samples for external utfcpp
2021-04-08 09:17:27 -07:00
Terence Parr eec33c5210
Merge branch 'master' into patch-1 2021-04-08 09:16:57 -07:00
Terence Parr 765de17f2a
Merge pull request #3073 from jirislaby/master
Cpp/runtime: use utfcpp from system if possible
2021-04-08 09:15:30 -07:00
Terence Parr c254f00921
Merge pull request #3146 from b1f6c1c4/patch-1
Fix typo in ExternalAntlr4Cpp.cmake
2021-04-08 09:14:51 -07:00
Alexander Bigerl 6a46c1dcb0
Update contributors.txt 2021-04-08 16:24:49 +02:00
Alexander Bigerl 3238961241
Merge branch 'master' into patch-1 2021-04-08 16:06:07 +02:00
b1f6c1c4 e6023b7555
sign contributors.txt 2021-04-07 17:46:55 -04:00
b1f6c1c4 0172e8661f
Update ExternalAntlr4Cpp.cmake 2021-04-07 17:42:27 -04:00
Terence Parr 4dfacf63e2
Merge pull request #3144 from xTachyon/on_exit_opt
[C++] Performance improvement in finally
2021-04-04 09:05:47 -07:00
Andrei DAMIAN e7bdb71a28 c++ finally don't use std::function 2021-04-03 18:22:17 +03:00
ericvergnaud 3590d4d5e1
Merge pull request #3130 from antlr/fix-3216
Fix #3126
2021-03-19 10:55:52 +08:00
Jiri Slaby 5a808b470e Cpp/runtime: use utf8cpp from system if possible
Try to find system's utf8cpp first, instead of downloading it from
github. utf8cpp 3 defines a cmake package, so we can use find_package.
Older utf8cpps don't, so we try also find_path. If all that fails, we
still fall back to github download.

This is needed as distributions cannot download stuff from their build
systems. And people want to use libraries/headers from the distribution
anyway.

I had to reorder the file a bit, so that the libraries are defined
through the utf8cpp detection
2021-02-23 08:19:40 +01:00
Jiri Slaby ac10e7bb79 contributors.txt: sign it 2021-02-23 08:19:39 +01:00
Alexander Bigerl ed2631b2d0
Merge branch 'master' into patch-1 2021-02-01 08:38:46 +01:00
Alexander Bigerl d2bc3a5cde
Update contributors.txt 2021-01-19 09:08:26 +01:00
Alexander Bigerl 680a42e023
No building tests/samples for external utfcpp 2021-01-19 09:06:21 +01:00
Matthew Paletta 3b3da29d45
Merge branch 'master' into master 2020-08-26 13:30:32 -07:00
Matthew Paletta 6e3d900c96 Resynced to master 2020-07-04 21:34:28 -07:00
Matthew Paletta 0daa97a5f0 Added templated move support for antlrcpp::Any 2020-06-15 16:52:47 -07:00
11 changed files with 84 additions and 41 deletions

View File

@ -269,6 +269,7 @@ YYYY/MM/DD, github id, Full name, email
2020/06/02, cohomology, Kilian Kilger, kkilger AT gmail.com
2020/06/04, IohannRabeson, Iohann Rabeson, iotaka6@gmail.com
2020/06/04, sigmasoldi3r, Pablo Blanco, pablobc.1995@gmail.com
2020/06/15, mattpaletta, Matthew Paletta, mattpaletta@gmail.com
2020/07/01, sha-N, Shan M Mathews, admin@bluestarqatar.com
2020/08/22, stevenjohnstone, Steven Johnstone, steven.james.johnstone@gmail.com
2020/09/06, ArthurSonzogni, Sonzogni Arthur, arthursonzogni@gmail.com
@ -286,7 +287,10 @@ YYYY/MM/DD, github id, Full name, email
2020/12/03, electrum, David Phillips, david@acz.org
2021/01/25, l215884529, Qiheng Liu, 13607681+l215884529@users.noreply.github.com
2021/02/02, tsotnikov, Taras Sotnikov, taras.sotnikov@gmail.com
2021/02/10, jirislaby, Jiri Slaby, jirislaby@gmail.com
2021/02/21, namasikanam, Xingyu Xie, namasikanam@gmail.com
2021/02/27, khmarbaise, Karl Heinz Marbaise, github@soebes.com
2021/03/02, hackeris
2021/03/03, xTachyon, Damian Andrei, xTachyon@users.noreply.github.com
2021/04/07, b1f6c1c4, Jinzheng Tu, b1f6c1c4@gmail.com
2021/04/24, bigerl, Alexander Bigerl, alexander [äät] bigerl [pkt] eu

1
dsfsfsdf Normal file
View File

@ -0,0 +1 @@
werrwrw3er

5
dsjdjsfjk.js Normal file
View File

@ -0,0 +1,5 @@
dsdfewrfff
function d(){
dsflsfks;lfksldf
}

View File

@ -112,7 +112,7 @@ else()
EXCLUDE_FROM_ALL 1)
endif()
# Seperate build step as rarely people want both
# Separate build step as rarely people want both
set(ANTLR4_BUILD_DIR ${ANTLR4_ROOT})
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14.0")
# CMake 3.14 builds in above's SOURCE_SUBDIR when BUILD_IN_SOURCE is true

View File

@ -1,19 +1,3 @@
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
set(THIRDPARTY_DIR ${CMAKE_BINARY_DIR}/runtime/thirdparty)
set(UTFCPP_DIR ${THIRDPARTY_DIR}/utfcpp)
ExternalProject_Add(
utfcpp
GIT_REPOSITORY "git://github.com/nemtrif/utfcpp"
GIT_TAG "v3.1.1"
SOURCE_DIR ${UTFCPP_DIR}
UPDATE_DISCONNECTED 1
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${UTFCPP_DIR}/install -Dgtest_force_shared_crt=ON
TEST_AFTER_INSTALL 1
STEP_TARGETS build)
include_directories(
${PROJECT_SOURCE_DIR}/runtime/src
${PROJECT_SOURCE_DIR}/runtime/src/atn
@ -23,8 +7,6 @@ include_directories(
${PROJECT_SOURCE_DIR}/runtime/src/tree
${PROJECT_SOURCE_DIR}/runtime/src/tree/pattern
${PROJECT_SOURCE_DIR}/runtime/src/tree/xpath
${UTFCPP_DIR}/install/include/utf8cpp
${UTFCPP_DIR}/install/include/utf8cpp/utf8
)
@ -50,8 +32,48 @@ add_custom_target(make_lib_output_dir ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_OUTPUT_DIR}
)
add_dependencies(antlr4_shared make_lib_output_dir utfcpp)
add_dependencies(antlr4_static make_lib_output_dir utfcpp)
add_dependencies(antlr4_shared make_lib_output_dir)
add_dependencies(antlr4_static make_lib_output_dir)
find_package(utf8cpp QUIET)
set(INSTALL_utf8cpp FALSE)
if (utf8cpp_FOUND)
target_link_libraries(antlr4_shared utf8cpp)
target_link_libraries(antlr4_static utf8cpp)
else()
# older utf8cpp doesn't define the package above
find_path(utf8cpp_HEADER utf8.h
PATH_SUFFIXES utf8cpp
)
if (utf8cpp_HEADER)
include_directories(${utf8cpp_HEADER})
else()
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
set(THIRDPARTY_DIR ${CMAKE_BINARY_DIR}/runtime/thirdparty)
set(UTFCPP_DIR ${THIRDPARTY_DIR}/utfcpp)
ExternalProject_Add(
utf8cpp
GIT_REPOSITORY "git://github.com/nemtrif/utfcpp"
GIT_TAG "v3.1.1"
SOURCE_DIR ${UTFCPP_DIR}
UPDATE_DISCONNECTED 1
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${UTFCPP_DIR}/install -DUTF8_TESTS=off -DUTF8_SAMPLES=off
STEP_TARGETS build)
include_directories(
${UTFCPP_DIR}/install/include/utf8cpp
${UTFCPP_DIR}/install/include/utf8cpp/utf8
)
add_dependencies(antlr4_shared utf8cpp)
add_dependencies(antlr4_static utf8cpp)
set(INSTALL_utf8cpp TRUE)
endif()
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_libraries(antlr4_shared ${UUID_LIBRARIES})
@ -131,13 +153,15 @@ install(DIRECTORY "${PROJECT_SOURCE_DIR}/runtime/src/"
FILES_MATCHING PATTERN "*.h"
)
install(FILES "${UTFCPP_DIR}/source/utf8.h"
DESTINATION "include/antlr4-runtime")
install(DIRECTORY "${UTFCPP_DIR}/source/utf8"
DESTINATION "include/antlr4-runtime"
COMPONENT dev
FILES_MATCHING PATTERN "*.h"
)
if (INSTALL_utf8cpp)
install(FILES "${UTFCPP_DIR}/source/utf8.h"
DESTINATION "include/antlr4-runtime")
install(DIRECTORY "${UTFCPP_DIR}/source/utf8"
DESTINATION "include/antlr4-runtime"
COMPONENT dev
FILES_MATCHING PATTERN "*.h"
)
endif()

View File

@ -34,7 +34,6 @@
#include <exception>
#include <bitset>
#include <condition_variable>
#include <functional>
#ifndef USE_UTF8_INSTEAD_OF_CODECVT
#include <codecvt>

View File

@ -65,16 +65,26 @@ struct ANTLR4CPP_PUBLIC Any
return derived->value;
}
template<class U>
template<class U, typename std::enable_if<std::is_copy_constructible<U>::value || std::is_copy_assignable<U>::value>::value>
operator U() {
return as<StorageType<U>>();
}
template<class U>
template<class U, typename std::enable_if<(!std::is_copy_constructible<U>::value && !std::is_copy_assignable<U>::value) && (std::is_move_constructible<U>::value || std::is_move_assignable<U>::value)>::value>
operator U() {
return std::move(as<StorageType<U>>());
}
template<class U, typename std::enable_if<std::is_copy_constructible<U>::value || std::is_copy_assignable<U>::value>::value>
operator const U() const {
return as<const StorageType<U>>();
}
template<class U, typename std::enable_if<!(!std::is_copy_constructible<U>::value && !std::is_copy_assignable<U>::value) && (std::is_move_constructible<U>::value || std::is_move_assignable<U>::value)>::value>
operator const U() const {
return std::move(as<const StorageType<U>>());
}
Any& operator = (const Any& a) {
if (_ptr == a._ptr)
return *this;
@ -99,7 +109,7 @@ struct ANTLR4CPP_PUBLIC Any
virtual ~Any();
virtual bool equals(Any other) const {
virtual bool equals(const Any& other) const {
return _ptr == other._ptr;
}

View File

@ -202,12 +202,6 @@ namespace antlrcpp {
return result;
}
//----------------- FinallyAction ------------------------------------------------------------------------------------
FinalAction finally(std::function<void ()> f) {
return FinalAction(f);
}
//----------------- SingleWriteMultipleRead --------------------------------------------------------------------------
void SingleWriteMultipleReadLock::readLock() {

View File

@ -19,8 +19,9 @@ namespace antlrcpp {
std::string indent(const std::string &s, const std::string &indentation, bool includingFirst = true);
// Using RAII + a lambda to implement a "finally" replacement.
template <typename OnEnd>
struct FinalAction {
FinalAction(std::function<void ()> f) : _cleanUp { f } {}
FinalAction(OnEnd f) : _cleanUp { std::move(f) } {}
FinalAction(FinalAction &&other) :
_cleanUp(std::move(other._cleanUp)), _enabled(other._enabled) {
other._enabled = false; // Don't trigger the lambda after ownership has moved.
@ -29,11 +30,14 @@ namespace antlrcpp {
void disable() { _enabled = false; }
private:
std::function<void ()> _cleanUp;
OnEnd _cleanUp;
bool _enabled {true};
};
ANTLR4CPP_PUBLIC FinalAction finally(std::function<void ()> f);
template <typename OnEnd>
FinalAction<OnEnd> finally(OnEnd f) {
return FinalAction<OnEnd>(std::move(f));
}
// Convenience functions to avoid lengthy dynamic_cast() != nullptr checks in many places.
template <typename T1, typename T2>

1
sadads Normal file
View File

@ -0,0 +1 @@
zcxzcxzczc

1
sdfs.html Normal file
View File

@ -0,0 +1 @@
vvfsdsfsdf