diff --git a/.editorconfig b/.editorconfig index 4cf5203..0f14089 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,3 +6,9 @@ trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false + +[CMakeLists.txt] +charset = utf-8 +indent_style = space +indent_size = 2 +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 0d77001..c969d31 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,63 +2,4 @@ # Set default behavior to automatically normalize line endings. ############################################################################### * text=auto -*.sh eol=lf - -############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line -############################################################################### -#*.cs diff=csharp - -############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary - -############################################################################### -# behavior for image files -# -# image files are treated as binary by default. -############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain +*.sh eol=lf \ No newline at end of file diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index dc56c23..029f5cf 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -11,10 +11,31 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04] + os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2022, macos-latest] steps: - uses: actions/checkout@v4 - name: make - run: make + if: runner.os == 'Linux' + run: make CI_BUILD=1 - name: make check - run: make check + if: runner.os == 'Linux' + run: make check CI_BUILD=1 + - name: CMake Build (Windows) + if: runner.os == 'Windows' + run: | + cmake -S . -B build -G "Visual Studio 17 2022" -DBUILD_TESTS=ON -DBUILD_SAMPLES=ON -DCI_BUILD=ON + cmake --build build --config Release --target ALL_BUILD + - name: Run CTest (Windows) + if: runner.os == 'Windows' + run: cd build && ctest -C Release -T test --output-on-failure + - name: Install Ninja (macOS) + if: runner.os == 'macOS' + run: brew install ninja + - name: CMake Build (macOS) + if: runner.os == 'macOS' + run: | + cmake -S . -B build -G Ninja -DBUILD_TESTS=ON -DBUILD_SAMPLES=ON -DCI_BUILD=ON + cmake --build build + - name: Run CTest (macOS) + if: runner.os == 'macOS' + run: cd build && ctest --output-on-failure diff --git a/.gitignore b/.gitignore index 88153e5..d6d8ad9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - # Unicode Character Database files tools/ucd/*.txt @@ -12,68 +9,22 @@ tools/ucd/*.txt *.userprefs # Build results +[Bb]uild*/ [Dd]ebug/ [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ x64/ x86/ -bld/ [Bb]in/ [Oo]bj/ [Ll]og/ -# Visual Studio cache/options directory -.vs/ - # Visual Studio Code cache/options directory .vscode/ -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -project.fragment.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* +# Visual Studio cache/options directory +.vs/ # Visual C++ cache files ipch/ @@ -92,172 +43,8 @@ ipch/ *.vspx *.sap -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -#*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignoreable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt - # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush -.cr/ - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc \ No newline at end of file +!*.[Cc]ache/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d24d84..c80a58e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,9 @@ ## Release v0.3.0 (Under Development) * Removed the `lug::variable` template class and instead allow for natural use of types and variables in captures and attribute bindings. Variable state is automatically saved and restored across rule boundaries. -* Rewrote the expression objects as expression template classes rather than lambdas while implementing attribute state tracking. Will allow for additional optimizations into the future. +* Rewrote the expression function objects/lambdas as expression template classes. Allows for multiple passes over the expression tree as well as top-down and bottom-up traversal, which was needed when implementing attribute state tracking. This will also allow for additional optimizations into the future. * Renamed `syntactic_capture` to `semantic_capture_action` to reflect that it's executed during the semantic action evaluation phase. -* Make all variations of callables that return a non-void value that can be type-erased by `semantic_action` and `semantic_capture_action` to push their result on to the attribute result stack. +* Make all variations of callables that return a non-void value that can be type-erased by `semantic_action` and `semantic_capture_action` push their result onto the attribute result stack. * Attempting to bind a variable to a nonexistent value from the attribute result stack now throws an `attribute_stack_error`. * Allow for capturing text to a `lug::syntax` object or any string-like object that is convertible from `std::string_view`. * `implicit_space_rule` no longer causes a compiler warning with Clang, uses RAII to push/pop the thread-local white space rule for grammars. @@ -14,6 +14,7 @@ * Turned `lug::parser` into an alias of a new `lug::basic_parser` template class parameterized with an input source strategy. This allows for parsing and capturing of text without making a copy of the input. * Added list repetition operator `e1 >> e2` to the DSL that is shorthand for `e1 > *(e2 > e1)`. * Enabled `-Wconversion` and `-Wshadow` warnings for Clang and GCC and fixed warnings. +* Added CMake build support and removed old MSVS solution and vcxproj files. * Handle situation where compilation with RTTI is disabled. ## Release v0.2.0 (June 21, 2024) diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..61d0ace --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,113 @@ +# lug - Embedded DSL for PE grammar parser combinators in C++ +# Copyright (c) 2017-2024 Jesse W. Towner +# See LICENSE.md file for license details + +cmake_minimum_required(VERSION 3.10) + +project( + lug VERSION 0.3.0 + DESCRIPTION "Embedded DSL for PE grammar parser combinators in C++" + HOMEPAGE_URL "https://github.com/jwtowner/lug" + LANGUAGES CXX) + +option(BUILD_TESTS "Build tests" ON) +option(BUILD_SAMPLES "Build sample applications" ON) +option(CI_BUILD "Build is running on CI" OFF) + +include(CMakePackageConfigHelpers) +include(CTest) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND (UNIX AND NOT APPLE)) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=lld") +endif() + +add_library(lug INTERFACE) + +target_include_directories(lug INTERFACE + $ + $) + +target_compile_features(lug INTERFACE cxx_std_17) + +write_basic_package_version_file( + lug-config-version.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY SameMajorVersion) + +install( + TARGETS lug + EXPORT lug-targets + INCLUDES DESTINATION include) + +install( + EXPORT lug-targets + FILE lug-config-version.cmake + NAMESPACE lug:: + DESTINATION lib/cmake/lug) + +install(DIRECTORY lug/ DESTINATION include/lug) + +install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/lug-config-version.cmake" + DESTINATION lib/cmake/lug) + +function(setup_executable_target target_name) + set_target_properties(${target_name} PROPERTIES LANGUAGE CXX) + target_compile_features(${target_name} PRIVATE cxx_std_17) + target_link_libraries(${target_name} PRIVATE lug) + target_include_directories(${target_name} PRIVATE ${PROJECT_SOURCE_DIR}) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") + target_compile_options(${target_name} PRIVATE + -Wall -Wconversion -Wextra -Wextra-semi -Wshadow -Wsign-conversion -Wsuggest-override + -Wunreachable-code -Wno-parentheses -Wno-logical-not-parentheses + $<$:-Werror> + $<$,$>:-ffunction-sections -fdata-sections>) + if (UNIX AND NOT APPLE) + target_link_options(${target_name} PRIVATE + $<$,$>:-s>) + endif() + endif() + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(${target_name} PRIVATE -stdlib=libc++ -Wextra-semi-stmt -Wshadow-all) + target_link_options(${target_name} PRIVATE -stdlib=libc++) + if (UNIX AND NOT APPLE) + target_link_libraries(${target_name} PRIVATE c++ c++abi m) + target_link_options(${target_name} PRIVATE -fuse-ld=lld) + endif() + endif() + if (MSVC) + target_compile_options(${target_name} PRIVATE + /bigobj /W4 /permissive /sdl /utf-8 /Za /Zc:__cplusplus /Zc:rvalueCast /Zc:inline + /Zc:strictStrings /Zc:throwingNew /Zc:referenceBinding /Zc:wchar_t + $<$:/WX>) + target_link_options(${target_name} PRIVATE + $<$,$>:/OPT:REF /OPT:ICF>) + endif() +endfunction() + +if(BUILD_TESTS) + enable_testing() + file(GLOB TEST_SOURCES tests/*.cpp) + foreach(test_source ${TEST_SOURCES}) + get_filename_component(test_name ${test_source} NAME_WE) + add_executable(${test_name} ${test_source}) + setup_executable_target(${test_name}) + add_test(NAME ${test_name} COMMAND ${test_name} ) + endforeach() +endif() + +if(BUILD_SAMPLES) + file(GLOB SAMPLE_DIRS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} samples/*) + foreach(sample_dir ${SAMPLE_DIRS}) + get_filename_component(sample_name ${sample_dir} NAME_WE) + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${sample_dir}/${sample_name}.cpp) + add_executable(${sample_name} ${sample_dir}/${sample_name}.cpp) + setup_executable_target(${sample_name}) + endif() + endforeach() +endif() \ No newline at end of file diff --git a/Makefile b/Makefile index 91b5327..84df32f 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,16 @@ PREFIX = /usr/local # toolchain CXXSTD = -std=c++17 -CXXFLAGS = $(CXXSTD) -pedantic -Wall -Wconversion -Wextra -Wextra-semi -Wshadow -Wsign-conversion -Wsuggest-override -Wno-parentheses -Wno-logical-not-parentheses -Os -ffunction-sections -fdata-sections -I. +CXXFLAGS = $(CXXSTD) -pedantic -Wall -Wconversion $$(if [ "$(CI_BUILD)" = "1" ]; then echo "-Werror"; fi) \ + -Wextra -Wextra-semi -Wshadow -Wsign-conversion -Wsuggest-override -Wno-parentheses \ + -Wno-logical-not-parentheses -Os -ffunction-sections -fdata-sections -I. LDFLAGS = $(CXXSTD) -s CLANGTIDY = clang-tidy +ifeq ($(CI_BUILD),1) +CXXFLAGS += -Werror +endif + # unicode character database version UCD_VERSION = 15.1.0 @@ -35,7 +41,7 @@ TOOLS_OBJ = $(TOOLS:%=tools/%.o) DEPS = lug/lug.hpp lug/detail.hpp lug/error.hpp lug/unicode.hpp lug/utf8.hpp # distribution files -DISTFILES = CHANGELOG.md LICENSE.md README.md Makefile lug.sln runtests.sh .clang-tidy .editorconfig .gitattributes .gitignore doc/ lug/ msvs/ samples/ tests/ tools/ .github/ +DISTFILES = CHANGELOG.md LICENSE.md README.md CMakeLists.txt Makefile runtests.sh .clang-tidy .editorconfig .gitattributes .gitignore .github/ doc/ lug/ samples/ tests/ tools/ all: options samples tests diff --git a/lug.sln b/lug.sln deleted file mode 100644 index e907abf..0000000 --- a/lug.sln +++ /dev/null @@ -1,170 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27110.0 -MinimumVisualStudioVersion = 15.0.0.0 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{E698D93F-872B-4273-801C-07DDD9A0CB79}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lug", "lug", "{8A96E111-2F01-4E18-A185-7C8BA3C6076D}" - ProjectSection(SolutionItems) = preProject - lug\detail.hpp = lug\detail.hpp - lug\error.hpp = lug\error.hpp - lug\lug.hpp = lug\lug.hpp - lug\unicode.hpp = lug\unicode.hpp - lug\utf8.hpp = lug\utf8.hpp - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1B73BBCE-6D23-43C3-A9D2-961B38CFAE2C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "calc", "msvs\samples\calc.vcxproj", "{C917A525-845E-4CA1-AA5F-BC0F1FD42550}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "json", "msvs\samples\json.vcxproj", "{9C5A1B00-4496-4188-8B30-C2CE2916BFFA}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basic", "msvs\samples\basic.vcxproj", "{8793E9E0-0030-4B02-B760-BD559C5BB495}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "leftrecursion", "msvs\tests\leftrecursion.vcxproj", "{DA488748-356D-48D0-974B-8D9543A79018}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "terminals", "msvs\tests\terminals.vcxproj", "{973FD84B-A57B-40B1-833D-A2B1BB7D423C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "predicates", "msvs\tests\predicates.vcxproj", "{C4172D26-CBE2-4728-B56C-21BDA42ABEB1}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{782A1B1F-82A2-4338-9246-15B0BB5820CB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "makeunicode", "msvs\tools\makeunicode.vcxproj", "{EBEA573B-E6F0-49E6-96BA-1E7B6AAE6E2F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nonterminals", "msvs\tests\nonterminals.vcxproj", "{CE04F1AE-137C-4EDB-90D3-0B157518F644}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parser", "msvs\tests\parser.vcxproj", "{4831DCD8-6842-470B-90A1-9EFBBE46F42C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "symbols", "msvs\tests\symbols.vcxproj", "{AB2C5B8A-83F3-441A-8B5F-D79C0363E3AF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "conditions", "msvs\tests\conditions.vcxproj", "{E8B21A5A-50ED-4735-AA95-14B73E1506E8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "msvs\samples\xml.vcxproj", "{ABEBB2CC-C643-4A34-84D1-A1ED870EAE34}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C917A525-845E-4CA1-AA5F-BC0F1FD42550}.Debug|x64.ActiveCfg = Debug|x64 - {C917A525-845E-4CA1-AA5F-BC0F1FD42550}.Debug|x64.Build.0 = Debug|x64 - {C917A525-845E-4CA1-AA5F-BC0F1FD42550}.Debug|x86.ActiveCfg = Debug|Win32 - {C917A525-845E-4CA1-AA5F-BC0F1FD42550}.Debug|x86.Build.0 = Debug|Win32 - {C917A525-845E-4CA1-AA5F-BC0F1FD42550}.Release|x64.ActiveCfg = Release|x64 - {C917A525-845E-4CA1-AA5F-BC0F1FD42550}.Release|x64.Build.0 = Release|x64 - {C917A525-845E-4CA1-AA5F-BC0F1FD42550}.Release|x86.ActiveCfg = Release|Win32 - {C917A525-845E-4CA1-AA5F-BC0F1FD42550}.Release|x86.Build.0 = Release|Win32 - {9C5A1B00-4496-4188-8B30-C2CE2916BFFA}.Debug|x64.ActiveCfg = Debug|x64 - {9C5A1B00-4496-4188-8B30-C2CE2916BFFA}.Debug|x64.Build.0 = Debug|x64 - {9C5A1B00-4496-4188-8B30-C2CE2916BFFA}.Debug|x86.ActiveCfg = Debug|Win32 - {9C5A1B00-4496-4188-8B30-C2CE2916BFFA}.Debug|x86.Build.0 = Debug|Win32 - {9C5A1B00-4496-4188-8B30-C2CE2916BFFA}.Release|x64.ActiveCfg = Release|x64 - {9C5A1B00-4496-4188-8B30-C2CE2916BFFA}.Release|x64.Build.0 = Release|x64 - {9C5A1B00-4496-4188-8B30-C2CE2916BFFA}.Release|x86.ActiveCfg = Release|Win32 - {9C5A1B00-4496-4188-8B30-C2CE2916BFFA}.Release|x86.Build.0 = Release|Win32 - {8793E9E0-0030-4B02-B760-BD559C5BB495}.Debug|x64.ActiveCfg = Debug|x64 - {8793E9E0-0030-4B02-B760-BD559C5BB495}.Debug|x64.Build.0 = Debug|x64 - {8793E9E0-0030-4B02-B760-BD559C5BB495}.Debug|x86.ActiveCfg = Debug|Win32 - {8793E9E0-0030-4B02-B760-BD559C5BB495}.Debug|x86.Build.0 = Debug|Win32 - {8793E9E0-0030-4B02-B760-BD559C5BB495}.Release|x64.ActiveCfg = Release|x64 - {8793E9E0-0030-4B02-B760-BD559C5BB495}.Release|x64.Build.0 = Release|x64 - {8793E9E0-0030-4B02-B760-BD559C5BB495}.Release|x86.ActiveCfg = Release|Win32 - {8793E9E0-0030-4B02-B760-BD559C5BB495}.Release|x86.Build.0 = Release|Win32 - {DA488748-356D-48D0-974B-8D9543A79018}.Debug|x64.ActiveCfg = Debug|x64 - {DA488748-356D-48D0-974B-8D9543A79018}.Debug|x64.Build.0 = Debug|x64 - {DA488748-356D-48D0-974B-8D9543A79018}.Debug|x86.ActiveCfg = Debug|Win32 - {DA488748-356D-48D0-974B-8D9543A79018}.Debug|x86.Build.0 = Debug|Win32 - {DA488748-356D-48D0-974B-8D9543A79018}.Release|x64.ActiveCfg = Release|x64 - {DA488748-356D-48D0-974B-8D9543A79018}.Release|x64.Build.0 = Release|x64 - {DA488748-356D-48D0-974B-8D9543A79018}.Release|x86.ActiveCfg = Release|Win32 - {DA488748-356D-48D0-974B-8D9543A79018}.Release|x86.Build.0 = Release|Win32 - {973FD84B-A57B-40B1-833D-A2B1BB7D423C}.Debug|x64.ActiveCfg = Debug|x64 - {973FD84B-A57B-40B1-833D-A2B1BB7D423C}.Debug|x64.Build.0 = Debug|x64 - {973FD84B-A57B-40B1-833D-A2B1BB7D423C}.Debug|x86.ActiveCfg = Debug|Win32 - {973FD84B-A57B-40B1-833D-A2B1BB7D423C}.Debug|x86.Build.0 = Debug|Win32 - {973FD84B-A57B-40B1-833D-A2B1BB7D423C}.Release|x64.ActiveCfg = Release|x64 - {973FD84B-A57B-40B1-833D-A2B1BB7D423C}.Release|x64.Build.0 = Release|x64 - {973FD84B-A57B-40B1-833D-A2B1BB7D423C}.Release|x86.ActiveCfg = Release|Win32 - {973FD84B-A57B-40B1-833D-A2B1BB7D423C}.Release|x86.Build.0 = Release|Win32 - {C4172D26-CBE2-4728-B56C-21BDA42ABEB1}.Debug|x64.ActiveCfg = Debug|x64 - {C4172D26-CBE2-4728-B56C-21BDA42ABEB1}.Debug|x64.Build.0 = Debug|x64 - {C4172D26-CBE2-4728-B56C-21BDA42ABEB1}.Debug|x86.ActiveCfg = Debug|Win32 - {C4172D26-CBE2-4728-B56C-21BDA42ABEB1}.Debug|x86.Build.0 = Debug|Win32 - {C4172D26-CBE2-4728-B56C-21BDA42ABEB1}.Release|x64.ActiveCfg = Release|x64 - {C4172D26-CBE2-4728-B56C-21BDA42ABEB1}.Release|x64.Build.0 = Release|x64 - {C4172D26-CBE2-4728-B56C-21BDA42ABEB1}.Release|x86.ActiveCfg = Release|Win32 - {C4172D26-CBE2-4728-B56C-21BDA42ABEB1}.Release|x86.Build.0 = Release|Win32 - {EBEA573B-E6F0-49E6-96BA-1E7B6AAE6E2F}.Debug|x64.ActiveCfg = Debug|x64 - {EBEA573B-E6F0-49E6-96BA-1E7B6AAE6E2F}.Debug|x64.Build.0 = Debug|x64 - {EBEA573B-E6F0-49E6-96BA-1E7B6AAE6E2F}.Debug|x86.ActiveCfg = Debug|Win32 - {EBEA573B-E6F0-49E6-96BA-1E7B6AAE6E2F}.Debug|x86.Build.0 = Debug|Win32 - {EBEA573B-E6F0-49E6-96BA-1E7B6AAE6E2F}.Release|x64.ActiveCfg = Release|x64 - {EBEA573B-E6F0-49E6-96BA-1E7B6AAE6E2F}.Release|x64.Build.0 = Release|x64 - {EBEA573B-E6F0-49E6-96BA-1E7B6AAE6E2F}.Release|x86.ActiveCfg = Release|Win32 - {EBEA573B-E6F0-49E6-96BA-1E7B6AAE6E2F}.Release|x86.Build.0 = Release|Win32 - {CE04F1AE-137C-4EDB-90D3-0B157518F644}.Debug|x64.ActiveCfg = Debug|x64 - {CE04F1AE-137C-4EDB-90D3-0B157518F644}.Debug|x64.Build.0 = Debug|x64 - {CE04F1AE-137C-4EDB-90D3-0B157518F644}.Debug|x86.ActiveCfg = Debug|Win32 - {CE04F1AE-137C-4EDB-90D3-0B157518F644}.Debug|x86.Build.0 = Debug|Win32 - {CE04F1AE-137C-4EDB-90D3-0B157518F644}.Release|x64.ActiveCfg = Release|x64 - {CE04F1AE-137C-4EDB-90D3-0B157518F644}.Release|x64.Build.0 = Release|x64 - {CE04F1AE-137C-4EDB-90D3-0B157518F644}.Release|x86.ActiveCfg = Release|Win32 - {CE04F1AE-137C-4EDB-90D3-0B157518F644}.Release|x86.Build.0 = Release|Win32 - {4831DCD8-6842-470B-90A1-9EFBBE46F42C}.Debug|x64.ActiveCfg = Debug|x64 - {4831DCD8-6842-470B-90A1-9EFBBE46F42C}.Debug|x64.Build.0 = Debug|x64 - {4831DCD8-6842-470B-90A1-9EFBBE46F42C}.Debug|x86.ActiveCfg = Debug|Win32 - {4831DCD8-6842-470B-90A1-9EFBBE46F42C}.Debug|x86.Build.0 = Debug|Win32 - {4831DCD8-6842-470B-90A1-9EFBBE46F42C}.Release|x64.ActiveCfg = Release|x64 - {4831DCD8-6842-470B-90A1-9EFBBE46F42C}.Release|x64.Build.0 = Release|x64 - {4831DCD8-6842-470B-90A1-9EFBBE46F42C}.Release|x86.ActiveCfg = Release|Win32 - {4831DCD8-6842-470B-90A1-9EFBBE46F42C}.Release|x86.Build.0 = Release|Win32 - {AB2C5B8A-83F3-441A-8B5F-D79C0363E3AF}.Debug|x64.ActiveCfg = Debug|x64 - {AB2C5B8A-83F3-441A-8B5F-D79C0363E3AF}.Debug|x64.Build.0 = Debug|x64 - {AB2C5B8A-83F3-441A-8B5F-D79C0363E3AF}.Debug|x86.ActiveCfg = Debug|Win32 - {AB2C5B8A-83F3-441A-8B5F-D79C0363E3AF}.Debug|x86.Build.0 = Debug|Win32 - {AB2C5B8A-83F3-441A-8B5F-D79C0363E3AF}.Release|x64.ActiveCfg = Release|x64 - {AB2C5B8A-83F3-441A-8B5F-D79C0363E3AF}.Release|x64.Build.0 = Release|x64 - {AB2C5B8A-83F3-441A-8B5F-D79C0363E3AF}.Release|x86.ActiveCfg = Release|Win32 - {AB2C5B8A-83F3-441A-8B5F-D79C0363E3AF}.Release|x86.Build.0 = Release|Win32 - {E8B21A5A-50ED-4735-AA95-14B73E1506E8}.Debug|x64.ActiveCfg = Debug|x64 - {E8B21A5A-50ED-4735-AA95-14B73E1506E8}.Debug|x64.Build.0 = Debug|x64 - {E8B21A5A-50ED-4735-AA95-14B73E1506E8}.Debug|x86.ActiveCfg = Debug|Win32 - {E8B21A5A-50ED-4735-AA95-14B73E1506E8}.Debug|x86.Build.0 = Debug|Win32 - {E8B21A5A-50ED-4735-AA95-14B73E1506E8}.Release|x64.ActiveCfg = Release|x64 - {E8B21A5A-50ED-4735-AA95-14B73E1506E8}.Release|x64.Build.0 = Release|x64 - {E8B21A5A-50ED-4735-AA95-14B73E1506E8}.Release|x86.ActiveCfg = Release|Win32 - {E8B21A5A-50ED-4735-AA95-14B73E1506E8}.Release|x86.Build.0 = Release|Win32 - {ABEBB2CC-C643-4A34-84D1-A1ED870EAE34}.Debug|x64.ActiveCfg = Debug|x64 - {ABEBB2CC-C643-4A34-84D1-A1ED870EAE34}.Debug|x64.Build.0 = Debug|x64 - {ABEBB2CC-C643-4A34-84D1-A1ED870EAE34}.Debug|x86.ActiveCfg = Debug|Win32 - {ABEBB2CC-C643-4A34-84D1-A1ED870EAE34}.Debug|x86.Build.0 = Debug|Win32 - {ABEBB2CC-C643-4A34-84D1-A1ED870EAE34}.Release|x64.ActiveCfg = Release|x64 - {ABEBB2CC-C643-4A34-84D1-A1ED870EAE34}.Release|x64.Build.0 = Release|x64 - {ABEBB2CC-C643-4A34-84D1-A1ED870EAE34}.Release|x86.ActiveCfg = Release|Win32 - {ABEBB2CC-C643-4A34-84D1-A1ED870EAE34}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {C917A525-845E-4CA1-AA5F-BC0F1FD42550} = {E698D93F-872B-4273-801C-07DDD9A0CB79} - {9C5A1B00-4496-4188-8B30-C2CE2916BFFA} = {E698D93F-872B-4273-801C-07DDD9A0CB79} - {8793E9E0-0030-4B02-B760-BD559C5BB495} = {E698D93F-872B-4273-801C-07DDD9A0CB79} - {DA488748-356D-48D0-974B-8D9543A79018} = {1B73BBCE-6D23-43C3-A9D2-961B38CFAE2C} - {973FD84B-A57B-40B1-833D-A2B1BB7D423C} = {1B73BBCE-6D23-43C3-A9D2-961B38CFAE2C} - {C4172D26-CBE2-4728-B56C-21BDA42ABEB1} = {1B73BBCE-6D23-43C3-A9D2-961B38CFAE2C} - {EBEA573B-E6F0-49E6-96BA-1E7B6AAE6E2F} = {782A1B1F-82A2-4338-9246-15B0BB5820CB} - {CE04F1AE-137C-4EDB-90D3-0B157518F644} = {1B73BBCE-6D23-43C3-A9D2-961B38CFAE2C} - {4831DCD8-6842-470B-90A1-9EFBBE46F42C} = {1B73BBCE-6D23-43C3-A9D2-961B38CFAE2C} - {AB2C5B8A-83F3-441A-8B5F-D79C0363E3AF} = {1B73BBCE-6D23-43C3-A9D2-961B38CFAE2C} - {E8B21A5A-50ED-4735-AA95-14B73E1506E8} = {1B73BBCE-6D23-43C3-A9D2-961B38CFAE2C} - {ABEBB2CC-C643-4A34-84D1-A1ED870EAE34} = {E698D93F-872B-4273-801C-07DDD9A0CB79} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {1B319B7B-4BFF-4035-BF15-978C129D686C} - EndGlobalSection -EndGlobal diff --git a/lug/lug.hpp b/lug/lug.hpp index 4ae3c13..9a391d9 100644 --- a/lug/lug.hpp +++ b/lug/lug.hpp @@ -23,10 +23,9 @@ class encoder; class rule_encoder; class syntax; class environment; -class string_view_input_source; -class string_input_source; -class buffered_istream_input_source; class multi_input_source; +class string_input_source; +class string_view_input_source; template class basic_parser; using parser = basic_parser; struct program; @@ -1338,27 +1337,6 @@ template struct input_source_has_push_source> void enqueue(It first, It last) { buffer_ = std::string_view{&(*first), static_cast(last - first)}; } -}; - -class string_input_source -{ - std::string buffer_; - -public: - [[nodiscard]] std::string_view buffer() const noexcept { return buffer_; } - void drain_buffer(std::size_t sr) { buffer_.erase(0, sr); } - template > void enqueue(It first, It last) { buffer_.insert(buffer_.end(), first, last); } -}; - class multi_input_source { std::string buffer_; @@ -1400,6 +1378,27 @@ class multi_input_source } }; +class string_input_source +{ + std::string buffer_; + +public: + [[nodiscard]] std::string_view buffer() const noexcept { return buffer_; } + void drain_buffer(std::size_t sr) { buffer_.erase(0, sr); } + template > void enqueue(It first, It last) { buffer_.insert(buffer_.end(), first, last); } +}; + +class string_view_input_source +{ + std::string_view buffer_; + +public: + using enqueue_drains = std::true_type; + [[nodiscard]] constexpr std::string_view buffer() const noexcept { return buffer_; } + constexpr void drain_buffer(std::size_t sr) noexcept { buffer_.remove_prefix(sr); } + template > void enqueue(It first, It last) { buffer_ = std::string_view{&(*first), static_cast(last - first)}; } +}; + struct parser_registers { std::size_t sr, mr, rc; std::ptrdiff_t pc; std::size_t fc; diff --git a/msvs/samples/basic.vcxproj b/msvs/samples/basic.vcxproj deleted file mode 100644 index c458312..0000000 --- a/msvs/samples/basic.vcxproj +++ /dev/null @@ -1,169 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {8793E9E0-0030-4B02-B760-BD559C5BB495} - Win32Proj - basic - 10.0.17763.0 - - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - - ..\..;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - Disabled - /bigobj %(AdditionalOptions) - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - WIN32;_CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - /bigobj %(AdditionalOptions) - - - Console - true - true - - - - - ..\..;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - Disabled - /bigobj %(AdditionalOptions) - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - _CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - /bigobj %(AdditionalOptions) - - - Console - true - true - - - - - - - - - \ No newline at end of file diff --git a/msvs/samples/basic.vcxproj.filters b/msvs/samples/basic.vcxproj.filters deleted file mode 100644 index 164a389..0000000 --- a/msvs/samples/basic.vcxproj.filters +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/msvs/samples/calc.vcxproj b/msvs/samples/calc.vcxproj deleted file mode 100644 index c39313e..0000000 --- a/msvs/samples/calc.vcxproj +++ /dev/null @@ -1,165 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {C917A525-845E-4CA1-AA5F-BC0F1FD42550} - Win32Proj - calc - 10.0.17763.0 - - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - - ..\..;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - Disabled - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - WIN32;_CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - - - Console - true - true - - - - - ..\..;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - Disabled - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - _CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - - - Console - true - true - - - - - - - - - \ No newline at end of file diff --git a/msvs/samples/calc.vcxproj.filters b/msvs/samples/calc.vcxproj.filters deleted file mode 100644 index 1c18392..0000000 --- a/msvs/samples/calc.vcxproj.filters +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/msvs/samples/json.vcxproj b/msvs/samples/json.vcxproj deleted file mode 100644 index d6b8639..0000000 --- a/msvs/samples/json.vcxproj +++ /dev/null @@ -1,165 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {9C5A1B00-4496-4188-8B30-C2CE2916BFFA} - Win32Proj - json - 10.0.17763.0 - - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - - ..\..;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - Disabled - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - WIN32;_CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - - - Console - true - true - - - - - ..\..;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - Disabled - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - _CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - - - Console - true - true - - - - - - - - - \ No newline at end of file diff --git a/msvs/samples/json.vcxproj.filters b/msvs/samples/json.vcxproj.filters deleted file mode 100644 index 829a2bc..0000000 --- a/msvs/samples/json.vcxproj.filters +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/msvs/samples/xml.vcxproj b/msvs/samples/xml.vcxproj deleted file mode 100644 index c1770a2..0000000 --- a/msvs/samples/xml.vcxproj +++ /dev/null @@ -1,169 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - Win32Proj - {abebb2cc-c643-4a34-84d1-a1ed870eae34} - xml - 10.0.17763.0 - - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - - ..\..;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - Disabled - /bigobj %(AdditionalOptions) - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - WIN32;_CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - /bigobj %(AdditionalOptions) - - - Console - true - true - - - - - ..\..;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - Disabled - /bigobj %(AdditionalOptions) - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - _CONSOLE;%(PreprocessorDefinitions) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - /bigobj %(AdditionalOptions) - - - Console - true - true - - - - - - - - - diff --git a/msvs/samples/xml.vcxproj.filters b/msvs/samples/xml.vcxproj.filters deleted file mode 100644 index f514785..0000000 --- a/msvs/samples/xml.vcxproj.filters +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/msvs/tests/conditions.vcxproj b/msvs/tests/conditions.vcxproj deleted file mode 100644 index 79e3eb0..0000000 --- a/msvs/tests/conditions.vcxproj +++ /dev/null @@ -1,165 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - Win32Proj - {e8b21a5a-50ed-4735-aa95-14b73e1506e8} - conditions - 10.0.17763.0 - - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - - - - - \ No newline at end of file diff --git a/msvs/tests/conditions.vcxproj.filters b/msvs/tests/conditions.vcxproj.filters deleted file mode 100644 index b5ced7e..0000000 --- a/msvs/tests/conditions.vcxproj.filters +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/msvs/tests/leftrecursion.vcxproj b/msvs/tests/leftrecursion.vcxproj deleted file mode 100644 index 986c261..0000000 --- a/msvs/tests/leftrecursion.vcxproj +++ /dev/null @@ -1,165 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {DA488748-356D-48D0-974B-8D9543A79018} - Win32Proj - leftrecursion - 10.0.17763.0 - - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - WIN32;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - _CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - - - - - \ No newline at end of file diff --git a/msvs/tests/leftrecursion.vcxproj.filters b/msvs/tests/leftrecursion.vcxproj.filters deleted file mode 100644 index 20ca2e6..0000000 --- a/msvs/tests/leftrecursion.vcxproj.filters +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/msvs/tests/nonterminals.vcxproj b/msvs/tests/nonterminals.vcxproj deleted file mode 100644 index 7199248..0000000 --- a/msvs/tests/nonterminals.vcxproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {CE04F1AE-137C-4EDB-90D3-0B157518F644} - Win32Proj - nonterminals - 10.0.17763.0 - - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - WIN32;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - ..\..;%(AdditionalIncludeDirectories) - stdcpp17 - true - true - Level4 - true - MaxSpeed - true - true - _CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - - - - - \ No newline at end of file diff --git a/msvs/tests/nonterminals.vcxproj.filters b/msvs/tests/nonterminals.vcxproj.filters deleted file mode 100644 index 9259b01..0000000 --- a/msvs/tests/nonterminals.vcxproj.filters +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/msvs/tests/parser.vcxproj b/msvs/tests/parser.vcxproj deleted file mode 100644 index 8bfc04a..0000000 --- a/msvs/tests/parser.vcxproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {4831DCD8-6842-470B-90A1-9EFBBE46F42C} - Win32Proj - parser - 10.0.17763.0 - - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - WIN32;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - _CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - - - - - \ No newline at end of file diff --git a/msvs/tests/parser.vcxproj.filters b/msvs/tests/parser.vcxproj.filters deleted file mode 100644 index 9cd8510..0000000 --- a/msvs/tests/parser.vcxproj.filters +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/msvs/tests/predicates.vcxproj b/msvs/tests/predicates.vcxproj deleted file mode 100644 index eac43cd..0000000 --- a/msvs/tests/predicates.vcxproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {C4172D26-CBE2-4728-B56C-21BDA42ABEB1} - Win32Proj - 10.0.17763.0 - predicates - - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - WIN32;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - _CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - - - - - \ No newline at end of file diff --git a/msvs/tests/predicates.vcxproj.filters b/msvs/tests/predicates.vcxproj.filters deleted file mode 100644 index 22f7bb7..0000000 --- a/msvs/tests/predicates.vcxproj.filters +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/msvs/tests/symbols.vcxproj b/msvs/tests/symbols.vcxproj deleted file mode 100644 index e982f47..0000000 --- a/msvs/tests/symbols.vcxproj +++ /dev/null @@ -1,165 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - Win32Proj - {ab2c5b8a-83f3-441a-8b5f-d79c0363e3af} - symbols - 10.0.17763.0 - - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - WIN32;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - _CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - - - - - \ No newline at end of file diff --git a/msvs/tests/symbols.vcxproj.filters b/msvs/tests/symbols.vcxproj.filters deleted file mode 100644 index 6fe6fd7..0000000 --- a/msvs/tests/symbols.vcxproj.filters +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/msvs/tests/terminals.vcxproj b/msvs/tests/terminals.vcxproj deleted file mode 100644 index 150f194..0000000 --- a/msvs/tests/terminals.vcxproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {973FD84B-A57B-40B1-833D-A2B1BB7D423C} - Win32Proj - terminals - 10.0.17763.0 - - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - WIN32;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - _CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - - - - - \ No newline at end of file diff --git a/msvs/tests/terminals.vcxproj.filters b/msvs/tests/terminals.vcxproj.filters deleted file mode 100644 index 9cd8510..0000000 --- a/msvs/tests/terminals.vcxproj.filters +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/msvs/tools/makeunicode.vcxproj b/msvs/tools/makeunicode.vcxproj deleted file mode 100644 index eb5afd7..0000000 --- a/msvs/tools/makeunicode.vcxproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {EBEA573B-E6F0-49E6-96BA-1E7B6AAE6E2F} - Win32Proj - makeunicode - 10.0.17763.0 - - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - $(Platform)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - _SILENCE_PARALLEL_ALGORITHMS_EXPERIMENTAL_WARNING;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Disabled - _SILENCE_PARALLEL_ALGORITHMS_EXPERIMENTAL_WARNING;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - MaxSpeed - true - true - _SILENCE_PARALLEL_ALGORITHMS_EXPERIMENTAL_WARNING;WIN32;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - ..\..;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - Level4 - true - Full - true - true - _SILENCE_PARALLEL_ALGORITHMS_EXPERIMENTAL_WARNING;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - - - - - - - - - \ No newline at end of file diff --git a/msvs/tools/makeunicode.vcxproj.filters b/msvs/tools/makeunicode.vcxproj.filters deleted file mode 100644 index 2f2235e..0000000 --- a/msvs/tools/makeunicode.vcxproj.filters +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/tests/parser.cpp b/tests/parser.cpp index 328d638..b70ebaf 100644 --- a/tests/parser.cpp +++ b/tests/parser.cpp @@ -56,7 +56,7 @@ void test_line_column_tracking() rule Word = lexeme[ str("officiates") < [&](environment& e, syntax x) { startpos[0] = e.position_begin(x); endpos[0] = e.position_end(x); } - | str("Everyone") < [&](environment& e, syntax x) { endpos[1] = e.position_end(x); startpos[1] = e.position_begin(x); } + | str("Everyone") < [&](environment& e, syntax x) { endpos[1] = e.position_end(x); startpos[1] = e.position_begin(x); } | str("Friday") < [&](environment& e, syntax x) { startpos[2] = e.position_begin(x); endpos[2] = e.position_end(x); } | str("story") < [&](environment& e, syntax x) { endpos[3] = e.position_end(x); startpos[3] = e.position_begin(x); } | +alpha