Skip to content

Commit 2b4c26c

Browse files
author
Roland Leißa
authored
Initial commit
0 parents  commit 2b4c26c

File tree

25 files changed

+1322
-0
lines changed

25 files changed

+1322
-0
lines changed

.clang-format

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
---
2+
Language: Cpp
3+
AccessModifierOffset: -4
4+
AlignAfterOpenBracket: Align
5+
AlignArrayOfStructures: Right
6+
AlignConsecutiveMacros: Consecutive
7+
AlignConsecutiveAssignments: Consecutive
8+
AlignConsecutiveBitFields: Consecutive
9+
AlignConsecutiveDeclarations: None
10+
AlignEscapedNewlines: Left
11+
AlignOperands: AlignAfterOperator
12+
AlignTrailingComments: true
13+
AllowAllArgumentsOnNextLine: false
14+
AllowAllConstructorInitializersOnNextLine: true
15+
AllowAllParametersOfDeclarationOnNextLine: false
16+
AllowShortEnumsOnASingleLine: true
17+
AllowShortBlocksOnASingleLine: Always
18+
AllowShortCaseLabelsOnASingleLine: true
19+
AllowShortFunctionsOnASingleLine: All
20+
AllowShortLambdasOnASingleLine: All
21+
AllowShortIfStatementsOnASingleLine: WithoutElse
22+
AllowShortLoopsOnASingleLine: true
23+
AlwaysBreakAfterDefinitionReturnType: None
24+
AlwaysBreakAfterReturnType: None
25+
AlwaysBreakBeforeMultilineStrings: false
26+
AlwaysBreakTemplateDeclarations: Yes
27+
AttributeMacros:
28+
- __capability
29+
BinPackArguments: true
30+
BinPackParameters: false
31+
BraceWrapping:
32+
AfterCaseLabel: false
33+
AfterClass: false
34+
AfterControlStatement: Never
35+
AfterEnum: false
36+
AfterFunction: false
37+
AfterNamespace: false
38+
AfterObjCDeclaration: false
39+
AfterStruct: false
40+
AfterUnion: false
41+
AfterExternBlock: false
42+
BeforeCatch: false
43+
BeforeElse: false
44+
BeforeLambdaBody: false
45+
BeforeWhile: false
46+
IndentBraces: false
47+
SplitEmptyFunction: false
48+
SplitEmptyRecord: false
49+
SplitEmptyNamespace: false
50+
BreakBeforeBinaryOperators: None
51+
BreakBeforeConceptDeclarations: true
52+
BreakBeforeBraces: Attach
53+
BreakBeforeInheritanceComma: false
54+
BreakInheritanceList: BeforeColon
55+
BreakBeforeTernaryOperators: true
56+
BreakConstructorInitializersBeforeComma: false
57+
BreakConstructorInitializers: BeforeComma
58+
BreakAfterJavaFieldAnnotations: false
59+
BreakStringLiterals: true
60+
ColumnLimit: 120
61+
CommentPragmas: '^ IWYU pragma:'
62+
CompactNamespaces: false
63+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
64+
ConstructorInitializerIndentWidth: 4
65+
ContinuationIndentWidth: 4
66+
Cpp11BracedListStyle: true
67+
DeriveLineEnding: true
68+
DerivePointerAlignment: false
69+
DisableFormat: false
70+
EmptyLineAfterAccessModifier: Never
71+
EmptyLineBeforeAccessModifier: LogicalBlock
72+
ExperimentalAutoDetectBinPacking: false
73+
FixNamespaceComments: true
74+
ForEachMacros:
75+
- foreach
76+
- Q_FOREACH
77+
- BOOST_FOREACH
78+
IfMacros:
79+
- KJ_IF_MAYBE
80+
IncludeBlocks: Regroup
81+
IncludeCategories:
82+
- Regex: '<c.*[^.][^h]>'
83+
Priority: 1
84+
- Regex: '<.*[^.][^h]>'
85+
Priority: 2
86+
- Regex: '<.*>'
87+
Priority: 3
88+
- Regex: '"sql/[[:alnum:]]+\.h"'
89+
Priority: 4
90+
- Regex: '"sql/[[:alnum:]]+/.*"'
91+
Priority: 5
92+
IncludeIsMainRegex: '(XXX)?$'
93+
IncludeIsMainSourceRegex: ''
94+
IndentAccessModifiers: false
95+
IndentCaseLabels: true
96+
IndentCaseBlocks: false
97+
IndentGotoLabels: false
98+
IndentPPDirectives: AfterHash
99+
IndentExternBlock: AfterExternBlock
100+
IndentRequires: false
101+
IndentWidth: 4
102+
IndentWrappedFunctionNames: false
103+
InsertTrailingCommas: None
104+
JavaScriptQuotes: Leave
105+
JavaScriptWrapImports: true
106+
KeepEmptyLinesAtTheStartOfBlocks: false
107+
LambdaBodyIndentation: Signature
108+
MacroBlockBegin: ''
109+
MacroBlockEnd: ''
110+
MaxEmptyLinesToKeep: 1
111+
NamespaceIndentation: None
112+
ObjCBinPackProtocolList: Auto
113+
ObjCBlockIndentWidth: 2
114+
ObjCBreakBeforeNestedBlockParam: true
115+
ObjCSpaceAfterProperty: false
116+
ObjCSpaceBeforeProtocolList: true
117+
PenaltyBreakAssignment: 2
118+
PenaltyBreakBeforeFirstCallParameter: 19
119+
PenaltyBreakComment: 300
120+
PenaltyBreakFirstLessLess: 120
121+
PenaltyBreakString: 1000
122+
PenaltyBreakTemplateDeclaration: 10
123+
PenaltyExcessCharacter: 1000000
124+
PenaltyReturnTypeOnItsOwnLine: 60
125+
PenaltyIndentedWhitespace: 0
126+
PointerAlignment: Left
127+
PPIndentWidth: -1
128+
ReferenceAlignment: Pointer
129+
ReflowComments: true
130+
ShortNamespaceLines: 1
131+
SortIncludes: CaseSensitive
132+
SortJavaStaticImport: Before
133+
SortUsingDeclarations: true
134+
SpaceAfterCStyleCast: false
135+
SpaceAfterLogicalNot: false
136+
SpaceAfterTemplateKeyword: false
137+
SpaceBeforeAssignmentOperators: true
138+
SpaceBeforeCaseColon: false
139+
SpaceBeforeCpp11BracedList: false
140+
SpaceBeforeCtorInitializerColon: true
141+
SpaceBeforeInheritanceColon: true
142+
SpaceBeforeParens: ControlStatements
143+
SpaceAroundPointerQualifiers: Default
144+
SpaceBeforeRangeBasedForLoopColon: true
145+
SpaceInEmptyBlock: false
146+
SpaceInEmptyParentheses: false
147+
SpacesBeforeTrailingComments: 1
148+
SpacesInAngles: Never
149+
SpacesInConditionalStatement: false
150+
SpacesInContainerLiterals: false
151+
SpacesInCStyleCastParentheses: false
152+
SpacesInLineCommentPrefix:
153+
Minimum: 1
154+
Maximum: -1
155+
SpacesInParentheses: false
156+
SpacesInSquareBrackets: false
157+
SpaceBeforeSquareBrackets: false
158+
BitFieldColonSpacing: Both
159+
Standard: Latest
160+
StatementAttributeLikeMacros:
161+
- Q_EMIT
162+
StatementMacros:
163+
- Q_UNUSED
164+
- QT_REQUIRE_VERSION
165+
TabWidth: 4
166+
UseCRLF: false
167+
UseTab: Never
168+
WhitespaceSensitiveMacros:
169+
- STRINGIZE
170+
- PP_STRINGIZE
171+
- BOOST_PP_STRINGIZE
172+
- NS_SWIFT_NAME
173+
- CF_SWIFT_NAME
174+
...

.github/workflows/linux.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: linux
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [ main ]
7+
8+
jobs:
9+
build-and-test:
10+
name: Build and test ${{matrix.build-type}} mode
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
build-type: [Debug, Release]
15+
16+
steps:
17+
- name: Clone recursively
18+
uses: actions/checkout@v3
19+
with:
20+
submodules: recursive
21+
22+
- name: Install newest g++, valgrind
23+
run: |
24+
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
25+
sudo apt-get update
26+
sudo apt-get install g++-13 valgrind
27+
export CXX=g++-13
28+
29+
- name: Configure
30+
run: CXX=g++-13 cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}}
31+
32+
- name: Build
33+
run: cmake --build ${{github.workspace}}/build -v
34+
35+
- name: Test with Valgrind
36+
run: valgrind --error-exitcode=1 --leak-check=full ${{github.workspace}}/build/bin/let ${{github.workspace}}/test/test.let

.github/workflows/macos.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: macos
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [ main ]
7+
8+
jobs:
9+
build-and-test:
10+
name: Build and test ${{matrix.build-type}} mode
11+
runs-on: macos-latest
12+
strategy:
13+
matrix:
14+
build-type: [Debug, Release]
15+
16+
steps:
17+
- name: Clone recursively
18+
uses: actions/checkout@v3
19+
with:
20+
submodules: recursive
21+
22+
- name: Install LLVM/Clang
23+
run: brew install llvm@16
24+
25+
- name: Configure
26+
run: |
27+
CXX="/usr/local/opt/llvm/bin/clang++" \
28+
CXXFLAGS="-stdlib=libc++ -fexperimental-library" \
29+
LDFLAGS="-L/usr/local/opt/llvm/lib/c++ -Wl,-rpath,/usr/local/opt/llvm/lib/c++" \
30+
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}}
31+
32+
- name: Build
33+
run: cmake --build ${{github.workspace}}/build -v
34+
35+
- name: Test
36+
run: ${{github.workspace}}/build/bin/let ${{github.workspace}}/test/test.let

.github/workflows/windows.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: windows
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [ main ]
7+
8+
jobs:
9+
build-and-test:
10+
name: Build and test ${{matrix.build-type}} mode
11+
runs-on: windows-2022
12+
strategy:
13+
matrix:
14+
build-type: [Debug, Release]
15+
16+
steps:
17+
- name: Clone recursively
18+
uses: actions/checkout@v3
19+
with:
20+
submodules: recursive
21+
22+
- name: Configure
23+
shell: cmd
24+
run: |
25+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
26+
set CC=cl.exe
27+
set CXX=cl.exe
28+
cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DBUILD_TESTING=ON -DFE_BUILD_EXAMPLES=ON
29+
30+
- name: Build
31+
shell: cmd
32+
run: |
33+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
34+
cmake --build ${{github.workspace}}/build -v
35+
36+
- name: Test
37+
shell: cmd
38+
run: ${{github.workspace}}/build/bin/let.exe ${{github.workspace}}/test/test.let

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
build*
3+
vgcore.*

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "external/Lyra"]
2+
path = external/lyra
3+
url = git@github.com:bfgroup/Lyra.git
4+
[submodule "external/fe"]
5+
path = external/fe
6+
url = ../fe.git

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v3.2.0
6+
hooks:
7+
- id: check-added-large-files
8+
- id: check-yaml
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
- repo: https://github.com/pre-commit/mirrors-clang-format
12+
rev: v16.0.4
13+
hooks:
14+
- id: clang-format

CMakeLists.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
2+
project(Let)
3+
4+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
5+
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (default Debug)" FORCE)
6+
endif()
7+
8+
if(MSVC)
9+
set(CMAKE_CXX_STANDARD 23) # /std:c++latest - unlocks non-stable c++20 features
10+
add_compile_options(/utf-8 /wd4146 /wd4245)
11+
else()
12+
set(CMAKE_CXX_STANDARD 20) # -std=c++20 for everyone else
13+
endif()
14+
15+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
16+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
17+
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
18+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
19+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
20+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
21+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
22+
23+
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}; shared libs: ${BUILD_SHARED_LIBS}")
24+
25+
if(WIN32)
26+
add_compile_definitions(NOMINMAX) # prevents windows.h defining min/max macros
27+
else()
28+
add_compile_options(-Wall -Wextra)
29+
endif()
30+
31+
set(FE_ABSL OFF)
32+
if(FE_ABSL)
33+
set(ABSL_PROPAGATE_CXX_STD ON)
34+
set(ABSL_ENABLE_INSTALL ON)
35+
find_package(abseil)
36+
endif()
37+
add_subdirectory(external/fe)
38+
add_subdirectory(src)

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Roland Leißa
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)