Repository navigation
Conversation
Port the multi-char operator detection and hover gloss from Python to Flow. The Python original includes full markdown hover strings; the Flow port exposes the token detection logic and a compact one-line gloss. Full markdown hover stays in the Python LSP server. Provides: - flowc_is_multi_char_op: check if a string is a known operator - flowc_syntax_token_at_position: find the operator covering a column in a line of text (checks 12 two-char operators) - flowc_syntax_hover_gloss: compact one-line description Operators covered: |>, ->, =>, ==, !=, <=, >=, &&, ||, .., <<, >> Test: tests/lang/test_lsp_syntax.flow has 19 checks, all pass under FLOW_HOST=python. Covers operator detection at first and second character positions, empty lines, column clamping, and hover glosses for known and unknown tokens. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…flow Port the receiver_before_dot and field_access_at functions from Python to Flow. The Python original uses regex; the Flow port does manual character scanning with identifier boundary checks. Provides: - flowc_receiver_before_dot: find the identifier before a dot at the cursor position (for completion after "ident.") - flowc_field_access_at: find (receiver, field) when the cursor is on "recv.field" (for field completion) Both handle whitespace between the receiver and dot. Identifiers must start with a letter or underscore. URI parsing, source parsing, and type checking stay in the Python LSP server. Test: tests/lang/test_lsp_intel.flow has 18 checks, all pass under FLOW_HOST=python. Covers basic receiver detection, field access extraction, whitespace handling, and failure cases (no dot, no receiver, cursor on receiver, empty field, numeric receiver). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Port the SVG escape, vector math, and interpolation helpers from Python to Flow. The Python original renders full SVG diagrams; the Flow port exposes the pure math and string helpers. Provides: - flowc_svg_escape: escape & < > for XML/SVG output - flowc_vec2_unit_x / flowc_vec2_unit_y: normalize a 2D vector - flowc_vec2_length: hypot (vector magnitude) - flowc_vec2_dot: 2D dot product - flowc_point_distance: Euclidean distance between two points - flowc_lerp: linear interpolation Test: tests/lang/test_geometry_diagram.flow has 15 checks, all pass under FLOW_HOST=python. Covers SVG escaping (all special chars, no-op, empty), vector normalization (3-4-5 triangle, zero vector), length, dot product, distance, and lerp at t=0, 0.5, 1. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ent.flow
Port the step label and cross-reference formatting functions from
Python to Flow. The Python original builds full proof documents; the
Flow port exposes the pure formatting helpers.
Provides:
- flowc_circled: Unicode circled number (1-20), fallback "(n)"
- flowc_step_label_latex: \textbf{N.} for LaTeX proof steps
- flowc_fmt_refs: "step N" / "step N and step M" / "step N, step M, and step K"
- flowc_from_refs: "From step N, " prefix
- flowc_under_refs: "Under the supposition in step N, " (singular/plural)
Test: tests/lang/test_proof_document.flow has 15 checks, all pass
under FLOW_HOST=python. Covers circled numbers (valid, out of range,
zero), LaTeX step labels, single/double/triple refs, empty refs,
and from/under prefix formatting.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Port the _strip_comments and _strip_dynamics_namespace functions from Python to Flow. The Python original is a full DSL parser and expander; the Flow port exposes the line-level helpers. Provides: - flowc_strip_comments: remove trailing # comment and strip whitespace - flowc_strip_dynamics_namespace: strip dyn./dynamics. namespace prefix so namespaced forms (dyn.dsys, dynamics.horizon) work as bare aliases Test: tests/lang/test_dynamics_dsl.flow has 11 checks, all pass under FLOW_HOST=python. Covers comment stripping, whitespace-only lines, both namespace prefixes, bare form passthrough, and comment stripping combined with namespace removal. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Port the _guess_effect_for_name function from fir_graphify.py to Flow. This classifies a function name into effect bits based on known IO and allocation name sets. Provides: - flowc_guess_effect_for_name: returns effect bits for a function name and extern flag. Extern functions get FFI. IO names (print, printf, puts, read, write, fopen, fclose, flow_gfx_*, flow_audio_*) get IO. Allocation names (malloc, calloc, realloc, free, alloc, arena_alloc) get ALLOCATES and WRITES_MEMORY. Test: added 9 checks to test_fir_analysis.flow (now 34 total), all pass under FLOW_HOST=python. Covers extern FFI, IO names, alloc names, prefix matching, pure functions, and combined extern+IO. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Port the identifier validation, word range, and completion prefix helpers from the LSP server to Flow. The Python original is a full JSON-RPC server; the Flow port exposes the pure string helpers. Provides: - flowc_is_valid_identifier: check ^[A-Za-z_][A-Za-z0-9_]*$ - flowc_word_range: range covering the word at a cursor position - flowc_completion_prefix: word or dyn. prefix at cursor for filtering completions (includes dots and underscores) Test: tests/lang/test_lsp_utils.flow has 18 checks, all pass under FLOW_HOST=python. Covers valid/invalid identifiers, word range extraction (on word, mid-word, space, beyond end), and completion prefix (simple word, mid-word, dot prefix, partial dot, start of line, after space). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Port the has_field_dsl, has_dynamics_dsl, and has_fill_shader_dsl functions from Python to Flow. The Python originals use regex; the Flow port does manual line-by-line scanning with word boundary checks. Provides: - flowc_has_field_dsl: detect field/boundary declarations - flowc_has_dynamics_dsl: detect bare and namespaced (dyn./dynamics.) dynamics DSL markers (dsys, horizon, sense on, ga evolve, closed, analyze, wfc field) - flowc_has_fill_shader_dsl: detect shader fill declarations with proper word boundary checking Test: tests/lang/test_dsl_detect.flow has 16 checks, all pass under FLOW_HOST=python. Covers field/boundary detection, indented forms, multi-line sources, bare and namespaced dynamics forms, shader fill detection, and negative cases (plain code, word boundary). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Compiler improvements from self-hosted rebuild: - Emit #include <math.h> in generated C (for sqrt etc.) - Parser: allow keyword as let variable name (TOK_KEYWORD check) - Resolve: strip "stdlib/" prefix from string imports so "stdlib/tensor.flow" resolves to lib/stdlib/tensor.flow - fir_analysis: forward declare str_starts_with Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Port the _slug_label function from proof_document.py to Flow. Converts a claim path to a slug-safe label by replacing special characters: / -> -, + -> plus, * -> star, | -> or, . -> -, = -> eq, « and » -> removed, space -> -. Test: added 6 checks to test_proof_document.flow (now 21 total), all pass under FLOW_HOST=python. Covers simple paths, + and *, = and |, spaces, empty string, and dot replacement. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
nn_autogen.flow uses import "lib/stdlib/nn.flow" which was not resolved correctly. Now both "stdlib/foo.flow" and "lib/stdlib/foo.flow" are stripped to resolve relative to search_dir. All 67 stdlib modules now emit C (with typecheck disabled). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
letinflowc_parse_stmtnow acceptsTOK_KEYWORDlike the standaloneflowc_parse_let).stdlib/prefix from string imports so"stdlib/tensor.flow"resolves tosearch_dir/tensor.flowinstead ofsearch_dir/stdlib/tensor.flow.<math.h>to the C generator preamble forsqrtand other math externs.str_starts_withinfir_analysis.flow.lsp_syntax.flow.lsp_intel.flow.geometry_diagram.flow.proof_document.flow.dynamics_dsl.flow.lsp_utils.flow.dsl_detect.flow.guess_effect_for_nametofir_analysis.flow.slug_labeltoproof_document.flow.Test plan
./flow run compiler/src/main.flowpasses (flowc: PASS)This pull request includes code written with the assistance of AI.
The code has not yet been reviewed by a human.
Generated with Devin