aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.cxx
AgeCommit message (Collapse)AuthorFilesLines
2023-06-09Diagnose multiple values in typed concatenation (GH issue #263)Boris Kolpackov1-26/+41
2023-06-08Add support for buildfile importationBoris Kolpackov1-105/+377
2023-05-31Provide implied configure_* and dist_* action registration for ad hoc recipesBoris Kolpackov1-2/+11
This makes it consistent with the existing ad hoc rules semantics.
2023-05-29Explicit group: pattern membersBoris Kolpackov1-12/+18
2023-05-29Explicit group: dynamic membersBoris Kolpackov1-2/+2
2023-05-29Explicit group: static membersBoris Kolpackov1-0/+3
2023-05-29Explicit group: syntax parsingBoris Kolpackov1-121/+403
2023-05-16Enter export stub targets with correct outBoris Kolpackov1-12/+36
2023-05-09Add support for dumping build system state in JSON format (GH issue #182)Boris Kolpackov1-2/+6
Specifically: 1. New --dump-format option. Valid values are `buildfile` and `json-v0.1`. 2. The --dump option now recognizes two additional values: `match-pre` and `match-post` to dump the state of pre/post-operations. The `match` value now only triggers dumping of the main operation.
2023-05-03Add --dump-scope and --dump-target options to limit --dump outputBoris Kolpackov1-2/+2
2023-01-31Minor improvement to diagnosticsBoris Kolpackov1-2/+6
2022-12-19Disable `)` escaping in buildspec, command line variable overridesBoris Kolpackov1-6/+5
Similar to line continuations, that would make directory paths on Windows unusable, for example: b info(C:\myproj\) Note that while this is less of a problem in command line variable overrides, we disable it there for consistency.
2022-12-19Disable line continuation in buildspec, command line variable overridesBoris Kolpackov1-4/+6
Line continuations would make directory paths on Windows unusable, for example: b C:\myproj\
2022-12-19Restore newline escaping (line continuations) in double-quoted stringsBoris Kolpackov1-3/+4
Also make effective escaping in buildspec and command line variable overrides consistent with double-quoted strings.
2022-12-15Add noexcept to move constructors and move assignment operatorsKaren Arutyunov1-6/+6
2022-12-15Improve escape sequence supportBoris Kolpackov1-125/+167
Specifically: 1. In the double-quoted strings we now only do effective escaping of the special `$("\` characters plus `)` for symmetry. 2. There is now support for "escape sequence expansion" in the form $\X where \X can be any of the C/C++ simple escape sequences (\n, \t, etc) plus \0 (which in C/C++ is an octal escape sequence). For example: info "foo$\n$\tbar$\n$\tbaz" Will print: buildfile:1:1: info: foo bar baz
2022-12-14Improve empty simple value to empty list of names reduction heuristicsBoris Kolpackov1-17/+45
Specifically, do not reduce typed RHS empty simple values for prepend/append and additionally for assignment provided LHS is typed and is a container.
2022-12-14Handle NULL values in $string() and $concat() functionsBoris Kolpackov1-1/+2
This is relied upon by the parser to provide conversion/concatenation semantics consistent with untyped values. Note that we handle NULL values only for types that have empty representation.
2022-12-12Adapt to dir_iterator API changeKaren Arutyunov1-1/+14
2022-12-02Fail if scope or target qualification in variable expansion is unknownBoris Kolpackov1-29/+69
There are three options here: we can "fall through" to an outer scope (there is always the global scope backstop; this is the old semantics, sort of), we can return NULL straight away, or we can fail. It feels like in most cases unknown scope or target is a mistake and doing anything other than failing is just making things harder to debug.
2022-11-29Move buildfiles to root_extra, use vector instead of unordered_setBoris Kolpackov1-1/+3
2022-11-29Improve diagnostics for value subscript out of evaluation contextBoris Kolpackov1-2/+21
2022-11-23Rework diag_buffer interface to facilitate correct destruction orderBoris Kolpackov1-1/+1
2022-11-08Make process exit diagnostics consistentBoris Kolpackov1-1/+1
In particular, we now always print error message on non-0 exit except in cases where such exit is ignored.
2022-11-08More work on child process diagnostics bufferingBoris Kolpackov1-2/+5
2022-10-27Suppress (potential) bogus GCC 12 -Wrestrict warningsBoris Kolpackov1-1/+1
2022-10-25Allow concatenation of path/dir_path type to be a path patternKaren Arutyunov1-6/+49
2022-10-24Allow non-parallel absolute src/out to support imported target taggingBoris Kolpackov1-11/+11
Also fix bug in out clearing.
2022-10-21Change attribute syntax in script to come after variable in set and for (set ↵Karen Arutyunov1-21/+25
x [...], for x [...])
2022-10-20Tweak documentation in parser::parse_for()Karen Arutyunov1-2/+2
2022-10-20Add support for for-loop element typeKaren Arutyunov1-8/+24
2022-10-20Diagnose incorrect output directory specificationBoris Kolpackov1-1/+24
2022-10-14Fix 'for [<attrs>] x: ...' to treat <attrs> as value attributesKaren Arutyunov1-12/+0
2022-10-13Add visibility, overridable variable attributesBoris Kolpackov1-11/+70
2022-10-13Switch to public/private variables modelBoris Kolpackov1-2/+10
Now unqualified variables are project-private and can be typified.
2022-10-10Preparatory work for public/private variable distinctionBoris Kolpackov1-5/+4
We still always use the public var_pool from context but where required, all access now goes through scope::var_pool().
2022-09-29Fix variable append logic in scriptBoris Kolpackov1-0/+12
2022-09-28Add support for typed value subscriptBoris Kolpackov1-5/+37
2022-09-27Fix bug in handling of name patterns with trailing dotKaren Arutyunov1-1/+8
2022-09-16Register fallback dist meta-operation rule for out of project targetsBoris Kolpackov1-1/+3
The problematic scenario this fixes is an ad hoc pattern rule (which we register for dist in order to inject any additional sources; see parser.cxx for details) that pulls a tool imported from the system (say /usr/bin/xxd).
2022-09-13Fix bug in handling of disabled recipes in ad hoc pattern rulesBoris Kolpackov1-3/+16
2022-09-09Evaluate target specific variable assignment/block on ad hoc membersBoris Kolpackov1-35/+99
This is in preparation for (again) not treating primary member of an ad hoc group as a group for variable lookup.
2022-09-05Allow empty prerequisites in prerequisite-specific variable assignment/blockBoris Kolpackov1-27/+52
The old semantics was not very consistent, consider: exe{foo}: cxx{$empty} # Ok. exe{foo}: cxx{$empty}: include = false # Not ok? So now both are ok, as well as the block variant: exe{foo}: cxx{$empty}: { include = false } Note that the empty prerequisite list in the dependency chain is still an error: ./: exe{$empty}: cxx{foo} # Error. Note also that the syntactically-empty prerequisite list was and still is an error: exe{foo}: : include = false # Error.
2022-09-02Add missing if! support in recipesBoris Kolpackov1-2/+2
2022-07-21Use bundle scope when deciding whether project is being distributedBoris Kolpackov1-2/+3
2022-07-21Add link to HOWTO entry in conditional dependency declaration warningBoris Kolpackov1-1/+3
2022-07-21Don't issue conditional dependency declaration warning for imported projectsBoris Kolpackov1-7/+19
2022-07-20Tweak diagnosticsBoris Kolpackov1-1/+1
2022-07-20Adjust conditional dependency declaration warning logicBoris Kolpackov1-5/+13
Now instead of ignoring imported stuff (which turned out to be racy), we only consider conditions up to the include boundary. The thinking here is that an included (but not sourced) buildfile is a standalone entity (e.g., imported project but also could be just a side-included buildfile). Note that unfortunately we will still be issuing warnings in imported projects since there is no straightforward way to know what is being distributed and what is not while parsing.
2022-07-19Warn about conditional dependency declarations during distributionBoris Kolpackov1-0/+42