Skip to content

Conversation

@SuperFola
Copy link
Member

Description

Finally storing the end position of our nodes allowed me to remove big ugly hacks in the diagnostics generation.

Checklist

  • I have read the Contributor guide
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation if needed (on https://github.com/ArkScript-lang/website, content/docs/) not needed, only internal changes
  • I have added tests that prove my fix/feature is working not needed, all edge cases are covered by the existing tests
  • New and existing tests pass locally with my changes

… of the end position of an error (no end = whole line)
…tem that can be shared with the error context
…tead of a big hacky optional expr & symbol & symbol size (that can or cannot match the size of the symbol)
@github-actions
Copy link

github-actions bot commented Aug 20, 2025

Static analysis report

Lizard report

Listing only functions with cyclomatic complexity >= 15 or NLOC >= 100 or parameters >= 6.

Filename Start line:end line Function name Parameters NLOC CCN
src/arkreactor/VM/VM.cpp 498:1960 Ark::VM::safeRun 3 1225 250
src/arkreactor/Compiler/Macros/Processor.cpp 239:616 Ark::internal::MacroProcessor::evaluate 3 354 125
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 552:723 Ark::internal::ASTLowerer::handleCalls 4 130 42
src/arkreactor/Error/Diagnostics.cpp 43:180 Ark::Diagnostics::makeContext 4 100 39
src/arkscript/JsonCompiler.cpp 27:260 JsonCompiler::_compile 1 200 36
src/arkreactor/Compiler/NameResolution/NameResolutionPass.cpp 161:265 Ark::internal::NameResolutionPass::visitKeyword 3 83 33
src/arkreactor/Compiler/AST/Parser.cpp 812:903 Ark::internal::Parser::string 1 88 32
src/arkreactor/Compiler/AST/Node.cpp 189:287 Ark::internal::Node::repr 0 84 28
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 138:241 Ark::internal::ASTLowerer::compileExpression 4 85 27
src/arkreactor/Compiler/Macros/Processor.cpp 102:185 Ark::internal::MacroProcessor::processNode 3 61 27
src/arkreactor/Compiler/AST/Node.cpp 289:362 Ark::internal::Node::debugPrint 1 64 24
src/arkreactor/Compiler/NameResolution/NameResolutionPass.cpp 55:159 Ark::internal::NameResolutionPass::visit 2 83 23
src/arkreactor/Compiler/AST/Parser.cpp 288:416 Ark::internal::Parser::import_ 1 98 23
src/arkreactor/VM/VM.cpp 2079:2183 Ark::VM::backtrace 3 89 22
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 267:326 Ark::internal::ASTLowerer::compileListInstruction 3 49 22
src/arkscript/Formatter.cpp 169:225 Formatter::format 3 53 16
src/arkreactor/Compiler/Macros/Processor.cpp 698:737 Ark::internal::MacroProcessor::isConstEval 1 35 16
src/arkscript/Formatter.cpp 275:316 Formatter::formatFunction 2 35 15
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 78:94 Ark::internal::ASTLowerer::nodeProducesOutput 1 13 15
src/arkreactor/Error/Diagnostics.cpp 182:195 Ark::Diagnostics::helper 6 13 2
Report about files you didn't modify in this PR
Filename Start line:end line Function name Parameters NLOC CCN
src/arkreactor/Compiler/BytecodeReader.cpp 274:667 Ark::BytecodeReader::display 4 347 105
src/arkscript/main.cpp 23:323 main 2 255 29
src/arkreactor/TypeChecker.cpp 110:194 Ark::types::generateError 5 72 24
include/utf8.hpp 138:184 utf8::isValid 1 44 21
src/arkreactor/Compiler/AST/Optimizer.cpp 33:83 Ark::internal::Optimizer::countAndPruneDeadCode 1 42 20
src/arkscript/REPL/Utils.cpp 52:184 Ark::internal::getColorPerKeyword 0 110 19
src/arkreactor/VM/Value.cpp 77:140 Ark::Value::toString 1 50 19
src/arkreactor/TypeChecker.cpp 28:108 Ark::types::displayContract 4 70 19
src/arkreactor/Compiler/NameResolution/StaticScope.cpp 68:109 Ark::internal::NamespaceScope::get 2 32 18
src/arkreactor/Compiler/Macros/Executors/Function.cpp 16:88 Ark::internal::FunctionExecutor::applyMacro 2 55 17
include/Ark/Compiler/AST/Predicates.hpp 132:156 Ark::internal::IsSymbol::operator ( ) 1 24 16
src/arkreactor/Compiler/IntermediateRepresentation/IROptimizer.cpp 12:198 Ark::internal::IROptimizer::IROptimizer 1 163 4

CppCheck report

Filename Line Type Description
src/arkreactor/VM/VM.cpp 372 error Iterators of different containers 'm_execution_contexts.emplace_back(std::make_unique())' and 'm_execution_contexts.front()' are used together.
Report files about files you didn't modify in this PR
Filename Line Type Description
include/Ark/VM/VM.inl 247 style Variable 'maybe_value_ptr' can be declared as pointer to const
src/arkreactor/Compiler/BytecodeReader.cpp 450 style struct member 'Arg::kind' is never used.
src/arkreactor/VM/Future.cpp 11 performance Variable 'm_value' is assigned in constructor body. Consider performing initialization in initialization list.
src/arkreactor/VM/State.cpp 189 style Consider using std::any_of, std::all_of, std::none_of algorithm instead of a raw loop.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 20, 2025

CodSpeed Performance Report

Merging #571 will degrade performances by 6.45%

Comparing feat/better-parser-position-tracking (582ae8a) with dev (120045f)

Summary

❌ 8 (👁 8) regressions
✅ 9 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
👁 New parser - Big - 665 nodes[2] 9.7 ms 10.4 ms -6.45%
👁 New parser - Bigger[3] 39.4 ms 41.3 ms -4.62%
👁 New parser - Medium - 83 nodes[1] 856.8 µs 903.7 µs -5.19%
👁 New parser - Simple - 39 nodes[0] 338.9 µs 362.1 µs -6.38%
👁 Welder - Big - 665 nodes[2] 34.6 ms 36.8 ms -6.06%
👁 Welder - Bigger[3] 64 ms 67.9 ms -5.88%
👁 Welder - Medium - 83 nodes[1] 1.8 ms 1.9 ms -4.28%
👁 Welder - Simple - 39 nodes[0] 948.3 µs 987.5 µs -3.97%

@SuperFola SuperFola force-pushed the feat/better-parser-position-tracking branch from b9817b9 to 582ae8a Compare August 20, 2025 10:15
@github-actions
Copy link

Fuzzing report

/usr/local/bin/afl-whatsup status check tool for afl-fuzz by Michal Zalewski

Summary stats

    Fuzzers alive : 0
   Dead or remote : 1 (included in stats)
   Total run time : 5 minutes, 0 seconds
      Total execs : 40 thousands
 Cumulative speed : 134 execs/sec
    Pending items : 144 faves, 1205 total
 Coverage reached : 11.69%
    Crashes saved : 0
      Hangs saved : 0

Cycles without finds : 0
Time without finds : 0

[+] Captured 46734 tuples (map size 218048, highest value 255, total values 425618956) in '/dev/null'.
[+] A coverage of 46734 edges were achieved out of 218048 existing (21.43%) with 1215 input files.

@coveralls
Copy link

Coverage Status

coverage: 87.175% (-0.3%) from 87.426%
when pulling 582ae8a on feat/better-parser-position-tracking
into 120045f on dev.

@SuperFola SuperFola merged commit 9898f9c into dev Aug 20, 2025
71 of 74 checks passed
@SuperFola SuperFola deleted the feat/better-parser-position-tracking branch August 20, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants