specification infra and string parsing#259
Merged
nikomatsakis merged 20 commits intodada-lang:mainfrom Feb 21, 2026
Merged
Conversation
…spec
Extract shared `dada-spec-common` crate so the mdbook preprocessor and
spec validator use identical logic for resolving paragraph IDs from
file path, heading context, and optional local name. This replaces
fully-qualified IDs in directives (e.g., `:::{spec} syntax.string-literals.basic`)
with contextual ones (e.g., `:::{spec} quoted rfc0001 unimpl`).
Also adds inline sub-paragraphs (`{spec}\`name\``), `unimpl` tag support,
and drafts the full string literals spec from RFC-0001.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Synchronize brace escaping to \{ / \} (was {{ / }}), add
triple-quote termination rule, string conversion section, and
implementation note to the spec. Delete RFC spec.md since spec
paragraphs now live inline in spec/src/syntax/string-literals.md.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add tag support (rfc, unimpl, etc.) to inline `{spec}` markers so
that `{spec}`triple-quoted unimpl`` renders an unimpl badge while
using only the name for the paragraph ID. Extract render_tag_badges()
into dada-spec-common so both block and inline directives share the
same badge generation. Update spec unimpl tags to reflect current
implementation status.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move existing tests to tests/adhoc/ and create spec-mirrored structure under tests/syntax/string_literals/ covering delimiters, escape sequences, interpolation, and type checking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate AI insights, tracking issues, and RFC workflow content from always-loaded CLAUDE.md includes into .claude/skills/ that load on demand. Delete .socratic-shell/ (superseded by skills) and .claude/behavior.md (stale). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add lexer support for `"""..."""` string literals, completing the first chunk of unimplemented string literal syntax from RFC-0001. The tokenizer detects `"""` as a triple-quote opener (not empty string + new string), scans content allowing embedded single/double quotes, and terminates on the first `"""` encountered. Also fixes a bug in the spec validator where inline sub-paragraph tags (e.g., `unimpl`) were incorrectly included in the paragraph ID instead of being parsed out as metadata. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract duplicated logic into shared helper methods: - escape_sequence() for escape handling in both string types - emit_unterminated_string() for the unterminated error pattern - peek_next_is_ascii() for two-char-ahead lookahead Fix span end-offsets to use one-past-end convention consistently with identifier and integer tokens. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ahead Replace peek_next_is_ascii byte-level lookahead with natural peek/consume/peek flow for triple-quote detection. Hoist clear_accumulated to top of string_literal, extract emit_string_literal helper, and simplify triple-quote closing with speculative push/pop. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a new `#? Ast:` probe kind to the test harness that dumps the compact AST representation of expressions inline in test files, with anchored regex matching and sed fix commands in failure reports. Use it to write TDD-style tests for multiline string dedenting, then implement the dedenting in the tokenizer: strip leading newline, strip trailing whitespace line, remove common whitespace prefix, and re-process escape sequences on the dedented raw source text. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
RFC features should track progress in their impl.md file (version-controlled, co-located with the design) rather than duplicating state in GitHub issues. Updated CLAUDE.md with a Skills section so the right skill is invoked at the right moment, and updated both the rfc-workflow and tracking-issues skills to clarify this boundary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds the raw string feature from RFC-0001: a string beginning with "\ followed by a newline preserves all content exactly as written, skipping automatic dedenting. Peek-ahead detection in string_literal() consumes the \ as a marker before escape scanning begins. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add five new spec chapters covering the full syntax that the parser handles today: lexical structure (tokens, keywords, operators, delimiters), items (functions, classes, structs, use declarations), statements (blocks, let bindings), expressions (operators, precedence, postfix ops, control flow), and types/permissions. Remove .development/ directory — content was duplicated between skills and existing rustdoc. Update CLAUDE.md and skills to remove stale references. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add EBNF productions throughout lexical-structure.md and items.md - Use expansive "... see list below ..." pattern for extensible productions - Merge keyword-recognition into identifier rule (no more subtractive rule) - Merge effect-combination, body-optional, default visibility into parent rules - Remove no-block-comments (pure negative rule serves no purpose) - Add Literal, Item, Visibility, Function, Effect, Class, Struct, UseDeclaration, WhereClause, GenericParameters, Parameters, Field, ClassMember productions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The spec preprocessor now understands EBNF code blocks inside `:::{spec}`
directives:
- `Item ::= ...` auto-expands from `{spec}` sub-bullets using `-nt` suffix
convention: `function-nt` → `Function` (nonterminal), `as` → `as` (terminal)
- All PascalCase nonterminals in EBNF blocks are hyperlinked to their
`## \`Name\` definition` sections, including cross-chapter links
- Expanded alternatives render one per line, aligned under `::=`
- Sub-bullet lists are hidden when EBNF expansion replaces them
- Section headings follow `## \`Function\` definition` convention for
automatic nonterminal map discovery
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- statements.md: Add Block, Statement, LetStatement, ExprStatement productions - expressions.md: Full precedence hierarchy (Expr → AssignExpr → OrExpr → ...), postfix operators as proper nonterminals (FieldAccess, Call, Await, PermissionOp), primary expressions with IfExpr, ReturnExpr, ConstructorExpr - items.md: Extract FunctionBody/ReturnType definitions, fix ClassMember to use Field/Method nonterminals, use comma-list notation throughout - conventions.md: Document EBNF notation including A,* and A,+ shorthand for comma-separated lists with optional trailing commas Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for dada-lang ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests annotated with #:FIXME_ICE expect to panic (ICE) in the type checker. When the ICE is fixed, the test fails to prompt annotation removal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
17 tests covering operator precedence (arithmetic, comparison, logical, assignment), unary operators (not, negate), postfix operators (field access, calls, await, permission ops), and primary expressions (literals, identifiers, if/else, return, constructor, parenthesized). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.
No description provided.