Skip to content

Commit

Permalink
Merge branch 'master' of github.com:eteran/nedit-ng into open-config-…
Browse files Browse the repository at this point in the history
…directory
  • Loading branch information
eteran committed Jan 11, 2025
2 parents efed2c1 + 61a960e commit 079e617
Show file tree
Hide file tree
Showing 720 changed files with 57,730 additions and 94,197 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: eteran
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
68 changes: 68 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build

on:
push:
branches: [master]
pull_request:
branches: [master]

env:
BUILD_TYPE: Release
jobs:
build_ubuntu_20:
runs-on: ubuntu-20.04
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: "5.12.8"
setup-python: 'false'

- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}}/build --parallel 4 --config ${{env.BUILD_TYPE}}

build_windows:
runs-on: windows-2022
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: "5.12.8"
setup-python: 'false'

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Configure
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G"Visual Studio 17 2022"
- name: Build
run:
cmake --build ${{github.workspace}}/build --parallel 4 --target ALL_BUILD --config ${{env.BUILD_TYPE}}

- name: Deploy app
run: |
mkdir nedit-ng-win64
cp ${{github.workspace}}/build/${{env.BUILD_TYPE}}/nedit-ng.exe nedit-ng-win64/
cp ${{github.workspace}}/build/${{env.BUILD_TYPE}}/nc-ng.exe nedit-ng-win64/
windeployqt --release nedit-ng-win64/nedit-ng.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: nedit-ng-win64
path: nedit-ng-win64/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.vscode/
build
CMakeLists.txt.user*
.vscode
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.15)

project(nedit-ng
LANGUAGES CXX
VERSION 2020.1)
project(nedit-ng
LANGUAGES CXX
VERSION 2025.1)

enable_testing()

Expand All @@ -27,11 +27,11 @@ set(CPACK_RPM_PACKAGE_LICENSE "GPL-2")
set(CPACK_RPM_PACKAGE_GROUP "Applications/Editors")

# build requirements...
# set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase-devel, qt5-linguist, gcc, gcc-c++, boost-devel, cmake")
# set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase-devel, qt5-linguist, gcc, gcc-c++, cmake")
set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.6")
set(CPACK_RPM_FILE_NAME RPM-DEFAULT)

set(CPACK_DEBIAN_PACKAGE_BUILD_DEPENDS "cmake (>= 3.0), qt5-default (>= 5.6), qtbase5-dev-tools (>= 5.6), qttools5-dev-tools (>= 5.6), qttools5-dev (>= 5.6), libboost-dev (>= 1.35), bison (>=3.0)")
set(CPACK_DEBIAN_PACKAGE_BUILD_DEPENDS "cmake (>= 3.0), qt5-default (>= 5.6), qtbase5-dev-tools (>= 5.6), qttools5-dev-tools (>= 5.6), qttools5-dev (>= 5.6), bison (>=3.0)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5core5a (>= 5.6), libqt5gui5 (>= 5.6), libqt5network5 (>= 5.6), libqt5printsupport5 (>= 5.6), libqt5widgets5 (>= 5.6), libqt5xml5 (>= 5.6)")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${CMAKE_PROJECT_HOMEPAGE_URL})
set(CPACK_DEBIAN_PACKAGE_SECTION "editors")
Expand All @@ -43,8 +43,6 @@ set(CPACK_STRIP_FILES "bin/nedit-import")
set(CPACK_STRIP_FILES "bin/nedit-ng")
include(CPack)

find_package(Boost 1.35 REQUIRED)

set(NEDIT_PURIFY OFF CACHE BOOL "Fill Unused TextBuffer space")
set(NEDIT_PER_TAB_CLOSE ON CACHE BOOL "Per Tab Close Buttons")
set(NEDIT_VISUAL_CTRL_CHARS ON CACHE BOOL "Visualize ASCII Control Characters")
Expand Down
14 changes: 8 additions & 6 deletions Interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.15)

find_package(BISON QUIET)
find_package(Qt5 5.5.0 REQUIRED Core)
Expand All @@ -21,7 +21,7 @@ add_library(Interpreter
interpret.h
parse.h
parse.cpp

${BISON_parser_OUTPUT_SOURCE}
)

Expand All @@ -34,11 +34,13 @@ PUBLIC
Qt5::Core
Util
GSL
PRIVATE
Boost::boost
)

target_add_warnings(Interpreter)

set_property(TARGET Interpreter PROPERTY CXX_STANDARD 14)
set_property(TARGET Interpreter PROPERTY CXX_EXTENSIONS OFF)
set_target_properties(Interpreter
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)
43 changes: 21 additions & 22 deletions Interpreter/DataValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
#ifndef DATA_VALUE_H_
#define DATA_VALUE_H_

#include "Util/string_view.h"
#include <string_view>

#include <gsl/span>

#include <limits>
#include <map>
#include <memory>
#include <string>
#include <system_error>

#include <boost/variant.hpp>
#include <variant>

#include <QString>

Expand All @@ -33,8 +33,8 @@ struct ArrayIterator {
Array::iterator it;
};

using Data = boost::variant<
boost::blank,
using Data = std::variant<
std::monostate,
int32_t,
std::string,
ArrayPtr,
Expand Down Expand Up @@ -87,9 +87,9 @@ inline DataValue make_value(bool n) {
return DV;
}

inline DataValue make_value(view::string_view str) {
inline DataValue make_value(std::string_view str) {
DataValue DV;
DV.value = str.to_string();
DV.value = std::string(str);
return DV;
}

Expand Down Expand Up @@ -124,56 +124,55 @@ inline DataValue make_value(LibraryRoutine routine) {
}

inline bool is_unset(const DataValue &dv) {
return dv.value.which() == 0;
return dv.value.index() == 0;
}

inline bool is_integer(const DataValue &dv) {
return dv.value.which() == 1;
return dv.value.index() == 1;
}

inline bool is_string(const DataValue &dv) {
return dv.value.which() == 2;
return dv.value.index() == 2;
}

inline bool is_array(const DataValue &dv) {
return dv.value.which() == 3;
return dv.value.index() == 3;
}

inline std::string to_string(const DataValue &dv) {

if (auto n = boost::get<int>(&dv.value)) {
return std::to_string(*n);
} else {
return boost::get<std::string>(dv.value);
if (auto n = std::get<int>(dv.value)) {
return std::to_string(n);
}
return std::get<std::string>(dv.value);
}

inline int to_integer(const DataValue &dv) {
return boost::get<int>(dv.value);
return std::get<int>(dv.value);
}

inline Program *to_program(const DataValue &dv) {
return boost::get<Program *>(dv.value);
return std::get<Program *>(dv.value);
}

inline LibraryRoutine to_subroutine(const DataValue &dv) {
return boost::get<LibraryRoutine>(dv.value);
return std::get<LibraryRoutine>(dv.value);
}

inline DataValue *to_data_value(const DataValue &dv) {
return boost::get<DataValue *>(dv.value);
return std::get<DataValue *>(dv.value);
}

inline Inst *to_instruction(const DataValue &dv) {
return boost::get<Inst *>(dv.value);
return std::get<Inst *>(dv.value);
}

inline ArrayPtr to_array(const DataValue &dv) {
return boost::get<ArrayPtr>(dv.value);
return std::get<ArrayPtr>(dv.value);
}

inline ArrayIterator to_iterator(const DataValue &dv) {
return boost::get<ArrayIterator>(dv.value);
return std::get<ArrayIterator>(dv.value);
}

#endif
Loading

0 comments on commit 079e617

Please sign in to comment.