Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# All files generated by standalone contexts are ignored in git statistic
src/das/**/*.cpp binary
src/das/**/*.h binary
utils/gen1-to-gen2/ds_parser.cpp binary
utils/gen1-to-gen2/ds_parser.output binary
daslib/_aot_generated/*.cpp binary

# Shell scripts must keep LF endings even when checked out under autocrlf=true.
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ jobs:
-**/stb_*.h
-modules/dasSQLITE/sqlite/**
-modules/dasMinfft/minfft/**
-utils/gen1-to-gen2/ds_parser.cpp
input: sarif-results/cpp.sarif
output: sarif-results/cpp.sarif

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/extended_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ jobs:
# No sccache launcher: this lane is nightly-only and runs uncached.
cmake --no-warn-unused-cli -B./build -G "${{ matrix.cmake_generator }}" -DCMAKE_BUILD_TYPE:STRING=Release \
$ACTIVE_MODULES -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
cmake --build ./build --config Release --target daslang gen1_to_gen2 daslang_static --parallel
cmake --build ./build --config Release --target daslang daslang_static --parallel
;;
linux)
echo "BIN=./bin" >> $GITHUB_ENV
Expand Down Expand Up @@ -306,7 +306,7 @@ jobs:
# ON via ci/release_modules.txt in this workflow.
run: |
set -eux
# The main extended_checks build only targets daslang/gen1_to_gen2/daslang_static.
# The main extended_checks build only targets daslang/daslang_static.
# Sequence loads dasGlfw + dasLiveHost + dasHV + dasAudio + dasPUGIXML +
# dasStbImage at runtime; build their dynamic-module targets first.
# No `cmake --install` -- the source tree already IS a usable daslang
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Task-specific instructions are split into skill files under `skills/`. You MUST

Multiple skill files may apply to one task: creating a new daslib module needs `skills/das_formatting.md`, `skills/daslib_modules.md`, and possibly `skills/internal/documentation_rst.md`.

**Formatter reminder:** format `.das` files with the MCP `format_file` tool (it calls `daslib/das_source_formatter`). NOT `utils/gen1-to-gen2/` - that is the v1->v2 syntax converter, not a formatter.
**Formatter reminder:** format `.das` files with the MCP `format_file` tool (it calls `daslib/das_source_formatter`). NOT `utils/gen1-to-gen2/` - that is the v1->gen2 syntax converter, not a formatter.

### Updating Instructions with New Knowledge

Expand Down
33 changes: 7 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,6 @@ FLEX(src/parser/ds_lexer.lpp)
FLEX(src/parser/ds2_lexer.lpp)
BISON(src/parser/ds_parser.ypp)
BISON(src/parser/ds2_parser.ypp)
BISON(utils/gen1-to-gen2/ds_parser.ypp)

SET(PARSER_GENERATED_SRC
# 1st parser
Expand Down Expand Up @@ -1170,14 +1169,6 @@ src/simulate/fs_file_info.cpp
)


SET(GEN1_TO_GEN2_SRC
${PROJECT_SOURCE_DIR}/utils/gen1-to-gen2/fmt.cpp
${PROJECT_SOURCE_DIR}/utils/gen1-to-gen2/formatter.cpp
${PROJECT_SOURCE_DIR}/utils/gen1-to-gen2/helpers.cpp
${PROJECT_SOURCE_DIR}/utils/gen1-to-gen2/ds_parser.cpp
CACHE INTERNAL "GEN1_TO_GEN2_SRC"
)

# MSVC first so clang-cl (CXX_COMPILER_ID==Clang but MSVC driver) takes /EHsc, not -fexceptions
if(MSVC)
set_source_files_properties(src/builtin/module_builtin_ast_serialize.cpp PROPERTIES
Expand All @@ -1189,11 +1180,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
)
endif()

# flex/bison output (the gen1_to_gen2 converter's own copy) is not ours to clean
IF(MSVC)
set_source_files_properties(${PROJECT_SOURCE_DIR}/utils/gen1-to-gen2/ds_parser.cpp PROPERTIES COMPILE_FLAGS "/W0")
ELSE()
set_source_files_properties(${PROJECT_SOURCE_DIR}/utils/gen1-to-gen2/ds_parser.cpp PROPERTIES COMPILE_FLAGS "-w")
IF(NOT MSVC)
# fmt's vendored format-inl.h noreturn helper: GCC needs -Wno-error, clang -Wno-invalid-noreturn
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set_source_files_properties(src/misc/format.cpp PROPERTIES COMPILE_FLAGS "-Wno-error")
Expand Down Expand Up @@ -1300,7 +1287,6 @@ SET(LIBDASCRIPT_COMPILER_SRC
${SIMULATE_FUSION_SRC}
${PARSER_GENERATED_SRC}
${PARSER_SRC}
${GEN1_TO_GEN2_SRC}
src/ast/ast_parse.cpp
src/ast/ast_optimize.cpp
src/ast/ast_const_folding.cpp
Expand Down Expand Up @@ -1598,17 +1584,6 @@ if (NOT ${DAS_TOOLS_DISABLED})
FILES_MATCHING PATTERN "*.das"
)

add_executable(gen1_to_gen2 ${PROJECT_SOURCE_DIR}/utils/gen1-to-gen2/main.cpp)
TARGET_LINK_LIBRARIES(gen1_to_gen2 libDaScriptDyn ${SRC_LIBRARIES})
ADD_DEPENDENCIES(gen1_to_gen2 libDaScriptDyn ${DAS_DYN_MODULES_LIBS})
target_include_directories(gen1_to_gen2 PRIVATE ${NEED_MODULES_PATH})

SETUP_CPP11(gen1_to_gen2)
DAS_APPLY_STRICT_WARNINGS(gen1_to_gen2)
SETUP_LTO(gen1_to_gen2)
SETUP_BIN_RPATH(gen1_to_gen2)
install(TARGETS gen1_to_gen2 RUNTIME DESTINATION ${DAS_INSTALL_BINDIR})

#IF(APPLE)
# add_executable(daslangOsx MACOSX_BUNDLE ${DAS_DASCRIPT_MAIN_SRC})
# TARGET_LINK_LIBRARIES(daslangOsx libDaScript libDaScriptTest Threads::Threads ${DAS_MODULES_LIBS})
Expand Down Expand Up @@ -1899,6 +1874,12 @@ install(FILES ${PROJECT_SOURCE_DIR}/utils/aot/main.das DESTINATION utils/aot)
# Install fix-lint-errors tool (mechanical lint auto-fixer)
install(FILES ${PROJECT_SOURCE_DIR}/utils/fix-lint-errors/main.das DESTINATION utils/fix-lint-errors)

install(DIRECTORY ${PROJECT_SOURCE_DIR}/utils/gen1-to-gen2/
DESTINATION utils/gen1-to-gen2
FILES_MATCHING PATTERN "*.das"
PATTERN "tests" EXCLUDE
)

# Install MCP server (stdio transport, no dasHV dependency)
# main.das — full server entry point
# cpp_main.das — cpp/agnostic-subset entry point
Expand Down
2 changes: 1 addition & 1 deletion ci/check_shipped_skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
# `daslang.exe` and every module DLL", which is fine; `daslang.exe utils/aot/main.das`
# is not. The discriminator is the next token: a flag, or a real file with an extension.
EXE_CMD = re.compile(
r"(?<![\w/])(daslang|daslang-live|das-fmt|gen1_to_gen2|dastest)\.exe"
r"(?<![\w/])(daslang|daslang-live|das-fmt|dastest)\.exe"
r"(?=\s+(?:-{1,2}[A-Za-z]|[A-Za-z0-9_./-]+\.(?:das|cpp|py|json|md)\b))")

# SOMEONE'S MACHINE, not a generic example. Deliberately not "any absolute path": the
Expand Down
2 changes: 1 addition & 1 deletion ci/packaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ publishes itself.
`winget-daslang.yaml.template` and PR it to microsoft/winget-pkgs.
5. **apt**: the `.deb` on the release page installs with
`sudo apt install ./daslang_<version>_amd64.deb` (binaries land in `/opt/daslang`,
`daslang`/`daslang-live`/`gen1_to_gen2` symlinked into `/usr/bin`). A hosted apt
`daslang`/`daslang-live` symlinked into `/usr/bin`). A hosted apt
repo is a later tier.
6. **pip** (automatic): `wheel_build.py` repacks each bundle into a platform wheel
(`daslang-<ver>-py3-none-{win_amd64,manylinux_2_NN_x86_64,manylinux_2_NN_aarch64,macosx_NN_0_arm64}.whl`)
Expand Down
2 changes: 1 addition & 1 deletion ci/packaging/deb_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mkdir -p "$PKG/opt/daslang" "$PKG/usr/bin" "$PKG/DEBIAN"
cp -a "$BUNDLE"/. "$PKG/opt/daslang/"

# the user-facing binaries; everything else is reached relative to /opt/daslang
for exe in daslang daslang-live gen1_to_gen2; do
for exe in daslang daslang-live; do
if [ -x "$PKG/opt/daslang/bin/$exe" ]; then
ln -s "/opt/daslang/bin/$exe" "$PKG/usr/bin/$exe"
fi
Expand Down
1 change: 0 additions & 1 deletion ci/packaging/homebrew-daslang.rb.template
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class Daslang < Formula
libexec.install Dir["#{root}/*"]
bin.install_symlink libexec/"bin/daslang"
bin.install_symlink libexec/"bin/daslang-live"
bin.install_symlink libexec/"bin/gen1_to_gen2"
end

test do
Expand Down
1 change: 0 additions & 1 deletion ci/packaging/scoop-daslang.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"bin": [
"bin\\daslang.exe",
"bin\\daslang-live.exe",
"bin\\gen1_to_gen2.exe",
"bin\\lint.exe",
"bin\\daspkg.exe",
"bin\\dascov.exe",
Expand Down
2 changes: 1 addition & 1 deletion ci/packaging/wheel_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
SUMMARY = "High-performance statically-typed scripting language for games and real-time applications"

# console_scripts shim per shipped executable; the scoop bucket exposes the same set
TOOLS = ["daslang", "daslang-live", "gen1_to_gen2", "lint", "daspkg", "dascov",
TOOLS = ["daslang", "daslang-live", "lint", "daspkg", "dascov",
"detect-dupe", "benchctl", "dastest", "das-fmt"]

EXCLUDE_TOP = ("include", "examples", "doc", "logs")
Expand Down
4 changes: 2 additions & 2 deletions ci/smoke_test_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"

# Two exe naming conventions exist:
# * CPP_SUFFIX — for binaries built via cmake `add_executable` (daslang,
# daslang-live, gen1_to_gen2): platform-natural suffix (.exe on Windows,
# daslang-live): platform-natural suffix (.exe on Windows,
# none on Linux/macOS).
# * DASEXE_SUFFIX — for binaries built via `daslang -exe`: ALWAYS `.exe` on
# every platform (utils/CMakeLists.txt: "daslang -exe appends `.exe` to the
Expand Down Expand Up @@ -76,6 +76,7 @@ COMPILE_TESTS=(
"daspkg|utils/daspkg/main.das"
"detect-dupe|utils/detect-dupe/main.das"
"fix-lint-errors|utils/fix-lint-errors/main.das"
"gen1-to-gen2|utils/gen1-to-gen2/main.das"
"jobque-timeline|utils/jobque-timeline/main.das"
"lint|utils/lint/main.das"
"mcp|utils/mcp/main.das"
Expand Down Expand Up @@ -106,7 +107,6 @@ COMPILE_TESTS=(
# and a bundle whose rpath points back at the build tree is present-but-dead on every
# user's box.
SHIPPED_EXE_TESTS=(
"gen1_to_gen2|cpp"
"daslang-live|cpp"
"benchctl|dasexe"
"dascov|dasexe"
Expand Down
2 changes: 1 addition & 1 deletion doc/reflections/das2rst.das
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def document_module_rtti(_root : string) {
def document_module_ast(_root : string) {
var mod = [get_module("ast_core"), find_module("ast")]
var groups <- array<DocGroup>(
group_by_regex("Compilation and file access", mod, %regex~(compile|compile_file|make_file_access)$%%),
group_by_regex("Compilation and file access", mod, %regex~(compile|compile_file|parse_file|make_file_access)$%%),
group_by_regex("Call generation", mod, %regex~(make_call)$%%),
group_by_regex("Visitor pattern", mod, %regex~visit.*%%),
group_by_regex("Expression generation", mod, %regex~(force_generated|get_expression_annotation|make_type_info_structure|stamp_missing_at)%%),
Expand Down
1 change: 1 addition & 0 deletions doc/source/reference/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ built-in leak-detection mechanism.
utils/dascov.rst
utils/lint.rst
utils/das_fmt.rst
utils/gen1_to_gen2.rst
utils/fix_lint_errors.rst
utils/daspkg.rst
utils/benchctl.rst
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/utils/das_fmt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ das-fmt formats daslang source files in place using
``format_file`` tool and the shipped ``pre-commit`` hook. The SDK
bundle also carries a prebuilt ``bin/das-fmt.exe``.

Not to be confused with ``gen1_to_gen2``, the gen1→gen2 syntax
Not to be confused with ``gen1-to-gen2``, the gen1→gen2 syntax
*converter*.

Quick start
Expand Down
42 changes: 42 additions & 0 deletions doc/source/reference/utils/gen1_to_gen2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.. _utils_gen1_to_gen2:

.. index::
single: Utils; gen1-to-gen2
single: Utils; v1 to gen2 converter

===========================================
gen1-to-gen2 --- v1 to gen2 Converter
===========================================

gen1-to-gen2 rewrites a daslang file written in v1 (indentation-delimited)
syntax into gen2 (braces and parentheses). It parses the file with type
inference off, so the tree mirrors the source one to one, collects every
edit as a byte range in the ORIGINAL text, and applies them in a single
pass. Only delimiters move: the code between them is copied verbatim.

Every comment in the input must appear in the output, in the same order.
An edit that would delete or absorb one is refused, and a file with a
refused edit is reported and left untouched rather than half converted.

Quick start
===========

::

daslang utils/gen1-to-gen2/main.das -- -p <file> # print the result
daslang utils/gen1-to-gen2/main.das -- -i <files...> # rewrite in place

Flags: ``-p``/``--print`` (write to stdout), ``-i``/``--inplace``,
``--gen15`` (convert the constructor syntax but keep the indentation and
the ``options gen2 = false`` marker), ``--semicolon`` (terminate the
generated header), ``--verify-compile`` (compile the result before
accepting it), ``--help`` for the rest.

The exit code is 1 when a file does not parse as v1 or an edit is
refused; nothing is written in either case. A file that is already gen2
is echoed unchanged, and a file using spoof templates is skipped, since
the template body is text the parser never sees as code.

.. seealso::

:ref:`utils_das_fmt` -- the formatter; it does not change syntax generation
2 changes: 1 addition & 1 deletion doc/source/reference/utils/mcp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Code generation and transformation
- Format a ``.das`` file using the built-in formatter.
* - ``convert_to_gen2``
- Convert a ``.das`` file from gen1 syntax to gen2 using
the ``gen1_to_gen2`` converter. Optional ``inplace`` flag.
the ``gen1-to-gen2`` converter. Optional ``inplace`` flag.
* - ``aot``
- Generate AOT (ahead-of-time) C++ code for a ``.das`` file or a
single function. Overloaded names return a disambiguation list.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Parses a daslang file and stops there — no type inference, no optimization, no simulation. The block receives ``(ok, program, issues)`` for the duration of the call, exactly like ``compile_file``.

The resulting AST mirrors the source one-to-one: make-syntax is not lowered, generics are not resolved, constants are not folded and no generated nodes are inserted. That is what source-rewriting tools need — a node's ``at`` still points at the construct the author wrote. A file that does not type-check still yields a usable tree, since nothing past the parse runs.

Modules the file requires are loaded normally (parsed and inferred), so ``require`` resolves; only the named file itself stops at the parse. Set ``codeOfPolicies.version_2_syntax`` to false to parse v1 syntax.

The tree is owned by the program and dies with it: keep only plain data (positions, strings) past the block, never an ``ExpressionPtr``.
7 changes: 7 additions & 0 deletions include/daScript/ast/ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -1705,6 +1705,13 @@ namespace das
DAS_CC_API ProgramPtr parseDaScript ( const string & fileName, const string & moduleName, const FileAccessPtr & access,
TextWriter & logs, ModuleGroup & libGroup, bool exportAll = false, bool isDep = false, CodeOfPolicies policies = CodeOfPolicies() );

DAS_CC_API ProgramPtr parseDaScriptNoInfer ( const string & fileName, const string & moduleName,
const FileAccessPtr & access, TextWriter & logs, ModuleGroup & libGroup, bool exportAll = false,
bool isDep = false, CodeOfPolicies policies = CodeOfPolicies() );

DAS_CC_API ProgramPtr parseDaScriptWithPrerequisits ( const string & fileName, const FileAccessPtr & access,
TextWriter & logs, ModuleGroup & libGroup, CodeOfPolicies policies = CodeOfPolicies() );

// this one collectes dependencies and compiles with modules
DAS_CC_API ProgramPtr compileDaScript ( const string & fileName, const FileAccessPtr & access,
TextWriter & logs, ModuleGroup & libGroup, CodeOfPolicies policies = CodeOfPolicies() );
Expand Down
3 changes: 2 additions & 1 deletion install/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ For path/filename ops use `fio` helpers (`base_name`/`dir_name`/`path_join`/...)

## SDK Directory Layout

- `bin/` - compiler and tool binaries: `daslang`, `daslang-live`, `gen1_to_gen2`, plus prebuilt tool exes (`lint.exe`, `das-fmt.exe`, `daspkg.exe`, `dascov.exe`, `detect-dupe.exe`, `benchctl.exe`, `dastest.exe` - the `.exe` suffix on every platform) and shared-module / tree-sitter libraries on Windows. Each tool also keeps its source form - `bin/daslang utils/<tool>/main.das`, except das-fmt (`utils/das-fmt/dasfmt.das`) and dastest (`dastest/dastest.das`). **Name trap:** `bin/gen1_to_gen2` is the gen1->gen2 syntax *converter*, not a formatter; the formatter is `das-fmt` (MCP `format_file`, `bin/das-fmt.exe`, or `bin/daslang utils/das-fmt/dasfmt.das`)
- `bin/` - compiler and tool binaries: `daslang`, `daslang-live`, plus prebuilt tool exes (`lint.exe`, `das-fmt.exe`, `daspkg.exe`, `dascov.exe`, `detect-dupe.exe`, `benchctl.exe`, `dastest.exe` - the `.exe` suffix on every platform) and shared-module / tree-sitter libraries on Windows. Each tool also keeps its source form - `bin/daslang utils/<tool>/main.das`, except das-fmt (`utils/das-fmt/dasfmt.das`) and dastest (`dastest/dastest.das`). **Name trap:** `utils/gen1-to-gen2/` is the gen1->gen2 syntax *converter*, not a formatter; the formatter is `das-fmt` (MCP `format_file`, `bin/das-fmt.exe`, or `bin/daslang utils/das-fmt/dasfmt.das`)
- `lib/`, `include/daScript/` - libraries and C++ headers for embedding
- `daslib/` - standard library modules (.das)
- `modules/` - optional plugin modules (dasHV, dasGlfw, dasPUGIXML, dasSQLITE, dasAudio, dasLLVM, dasLLAMA, ...)
Expand All @@ -199,6 +199,7 @@ For path/filename ops use `fio` helpers (`base_name`/`dir_name`/`path_join`/...)
- `utils/mcp/`, `utils/lsp/` - MCP and LSP servers for AI coding assistants
- `utils/lint/` - lint runner: `bin/daslang utils/lint/main.das -- <files> --quiet`
- `utils/das-fmt/` - the formatter script (`dasfmt.das`, wraps `daslib/das_source_formatter`)
- `utils/gen1-to-gen2/` - v1 (indentation) -> gen2 (braces) syntax converter, run as `bin/daslang utils/gen1-to-gen2/main.das -- <files>` (also the `convert_to_gen2` MCP tool)
- `utils/detect-dupe/` - cross-file duplicate-function detector (also the `export_corpus` / `detect_duplicates` MCP tools)
- `utils/find-dupe/` - Claude-based judge for detect-dupe reports (needs `ANTHROPIC_API_KEY`; also the `judge_duplicates`/`find_dupe` MCP tools)
- `utils/daspkg/`, `utils/dascov/` - package manager; code coverage
Expand Down
2 changes: 1 addition & 1 deletion install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

| Directory | Contents |
|--------------|-------------------------------------------------------|
| `bin/` | Compiler and tool binaries (`daslang`, `daslang-live`, `gen1_to_gen2`) |
| `bin/` | Compiler and tool binaries (`daslang`, `daslang-live`) |
| `lib/` | Static and shared libraries for embedding |
| `include/` | C++ headers for integration |
| `daslib/` | Standard library modules (`.das` files) |
Expand Down
2 changes: 1 addition & 1 deletion skills/das_formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ After creating or modifying any `.das` file that is part of the project (daslib

For a module under `modules/` whose files `require` sibling modules (e.g. `require openai/openai_chat`), pass `-load_module <moduleDir>` before `--` so cross-module requires resolve. The formatter only parses, so it works regardless; lint reports `SKIP ... missing prerequisite` for files it can't fully resolve (e.g. examples/tests before the module is registered/installed).

> **Not the converter:** the installed `bin/gen1_to_gen2` binary is the **v1->v2 syntax converter** (flags `-i` / `--tests` / `--semicolon`), not a code formatter. The formatter is the daslang script `utils/das-fmt/dasfmt.das` (flags `--path` / `--verify`) - invoke it through `bin/daslang utils/das-fmt/dasfmt.das -- ...` or the MCP `format_file` tool.
> **Not the converter:** `utils/gen1-to-gen2/main.das` is the **v1->gen2 syntax converter** (flags `-p` / `-i` / `--semicolon` / `--verify`), not a code formatter. The formatter is the daslang script `utils/das-fmt/dasfmt.das` (flags `--path` / `--verify`) - invoke it through `bin/daslang utils/das-fmt/dasfmt.das -- ...` or the MCP `format_file` tool.

**What the formatter does and does not do.** It normalizes spacing inside expressions (`if( a>0 )` -> `if (a > 0)`, `print( x )` -> `print(x)`). It does **not** re-indent: a misindented file is rewritten with its indentation untouched and still passes `--verify`, so it also passes the CI format gate. Indent width is taken from the file itself - inferred from the first indented line, or pinned by a file-level `options indenting = N` (clamped 1..8). Getting indentation right is on you; neither the formatter nor CI will catch it.

Expand Down
Loading
Loading