Skip to content

Commit

Permalink
Just merging to get a better view of where things are at (#6)
Browse files Browse the repository at this point in the history
* work in progress on normal assembly parsing

* formatting, added interface

* removed common state, theres little/no overlap

* replaced macro with matts template suggestion

* formatting

* fix format

* fix formatting

* auto format

* test hackery

* wip; add some actual tests to figure out which regexes work and which dont

* changed regexes

* refactored things

* more tests

* remove raw regex tests

* expandtabs and more testing

* fixed file definition parsing

* exception path, unlikely to happen, but still

* stdin/example detection

* list labels, unfiltered still

* some more code

* more code, more tests

* extract referenced labels from line

* add labels to json thing

* bugfixes

* fix label ranges

* needs better naming, but much better compiletimes

* some label marking functions

* somewhat working version of remove-unused-labels

* all kinds of fixes, working version for clang-maxArray.asm now

* escape fix

* produced by javascript

* make less copies and allocations, etc

* unordered_set to mark labels as used, other things are still slow

* use unordered map for labels_defined

* rewrote removeunused, but still slow

* just rebuild instead of removing things from the original

* bugfixes

* bugfix endproc regex

* bugfix indentation

* loop less

* bugfix end_col

* add squashing functions

* add squashwithquotes test

* bugfix outside-of-code unused labels

* experimental code

* bugfix original parser output, fixes #4

* .weak labels

* mark usage for global labels

* label links in .datadefs

* maybeaddblack things

* bugfix inline asm labels

* implement weird data filter

* conan io ctre is now up to date
  • Loading branch information
partouf authored Nov 23, 2020
1 parent 5f68756 commit 80181a8
Show file tree
Hide file tree
Showing 27 changed files with 1,668,157 additions and 191 deletions.
9 changes: 5 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ AlignEscapedNewlinesLeft: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
AlwaysBreakTemplateDeclarations: true
BinPackParameters: false
BreakBeforeBinaryOperators: false
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 100
ColumnLimit: 120
CommentPragmas: ''
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 0
Expand Down Expand Up @@ -43,4 +43,5 @@ SpacesInContainerLiterals: false
SpacesInParentheses: false
Standard: Cpp11
TabWidth: 4
UseTab: Never
UseTab: Never
AllowShortLambdasOnASingleLine: false
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
project(asm-parser)

set(CMAKE_CXX_STANDARD 20)
add_compile_options(-Werror -Wall -Wextra)
add_compile_options(-Werror -Wall -Wextra -flto -O3)

if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
Expand All @@ -13,9 +13,16 @@ endif ()

include(${CMAKE_BINARY_DIR}/conan.cmake)

conan_add_remote(NAME bincrafters INDEX 1
URL https://api.bintray.com/conan/bincrafters/public-conan)

conan_cmake_run(
CONANFILE conanfile.txt
BASIC_SETUP CMAKE_TARGETS
REQUIRES
ctre/3.2
catch2/2.12.4
approvaltests.cpp/10.3.0
fmt/7.0.3
BASIC_SETUP
BUILD missing)

include(${CMAKE_BINARY_DIR}/conan.cmake)
Expand Down
5 changes: 0 additions & 5 deletions conanfile.txt

This file was deleted.

5 changes: 3 additions & 2 deletions prettyjson.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

const fs = require('fs');
const path = require('path');

const args = process.argv.slice(2);

Expand All @@ -11,3 +9,6 @@ const input = JSON.parse(data);

const output = JSON.stringify(input, null, 2);
fs.writeFileSync(filename, output);

console.log("Number of lines: " + input.asm.length);
console.log("Number of labels: " + Object.keys(input.labelDefinitions).length);
Loading

0 comments on commit 80181a8

Please sign in to comment.