aboutsummaryrefslogtreecommitdiff
path: root/build/parser.cxx
AgeCommit message (Collapse)AuthorFilesLines
2016-01-05Rename build directory/namespace to build2Boris Kolpackov1-2206/+0
2015-12-16Implement support for multiple scope/targets in variable assignmentBoris Kolpackov1-86/+94
Can now even do this: foo/ file{*-bar} file{baz}: x = y
2015-12-14Make sure we don't link up to lib{} targets that are derived from liba/so{}Boris Kolpackov1-1/+5
2015-12-14Fix bugs in keyword recognition logicBoris Kolpackov1-3/+4
2015-12-14Add support for variable prepend operator: =+Boris Kolpackov1-7/+23
2015-12-10Implement two-phase initialization of modules loaded from bootstrap.buildBoris Kolpackov1-12/+16
2015-12-07Add support for specifying minimum required build2 versionBoris Kolpackov1-12/+52
The syntax is: using build@0.1.0-a1 The idea is that we will later also use it for modules and 'build' is a special, the "build system itself" module. Also fix a problem with peeking and lexer mode switching.
2015-12-03Implement new potential directive keyword testBoris Kolpackov1-4/+31
Now we can use directive names as variables and targets type, for example: print = foo # variable print{foo}: # target
2015-12-03Implement if-else conditionsBoris Kolpackov1-20/+172
if if! elif elif! else The expression should evaluate to true of false. The if! and elif! versions are provided as shortcuts to writing if (!...). See tests/if-else for examples.
2015-12-02Redo extension derivation for file{}, doc{}, and cli{}Boris Kolpackov1-0/+7
We now first check the 'extension' variable, then use the default.
2015-12-02Implement optional module loadingBoris Kolpackov1-6/+9
The syntax is: using? cli Now each module use results in two bool variables: <module>.loaded and <module>.configured. Also implement variable visibility (the above two variables are limited to project).
2015-12-01Reimplement define as dynamic derivation rather than aliasBoris Kolpackov1-22/+21
New syntax: define cli: file The rationale is we need to be able to assign the file extension (using type/pattern-specific variables). And if it is an alias, we will assign it to the original target type. Note that we could still support aliases if we need to. Will need to bring back the id member in target_type that would normally point to itself but for an alias would point to the origin.
2015-12-01Implement support for definition target type aliasesBoris Kolpackov1-1/+75
For example: define cli=file Currently, the semantics is that of a real alias with only name differences that are used for display. See tests/define/buildfile for more use cases.
2015-11-30Implement target type/pattern-specific variablesBoris Kolpackov1-18/+65
For example: cxx{*-options}: dist = true 1. Only single '*' wildcard is supported, matches 0 or more characters. 2. If target type is not specified, it defaults to any target. 3. Appending (+=) is not allowed. 4. The value is expanded immediately in the context of the scope. 5. The more specific pattern (i.e., with the shortest "stem") is preferred. If the stem has the same length, then the last defined (but not redefined) pattern is used. This will probably have to change to become an error. See tests/variable/type-pattern for more examples.
2015-11-28Add support for name crosses, for example {hxx ixx cxx}{foo bar}Boris Kolpackov1-31/+115
See tests/names for more examples.
2015-11-28Fix separated { handling in names parserBoris Kolpackov1-2/+2
'foo/ {a b}' should be equivalent to 'foo/ a b', not 'foo/a foo/b'.
2015-09-11Handle file io failures in parserBoris Kolpackov1-46/+60
2015-09-11Preserve pairs in expansionBoris Kolpackov1-0/+6
2015-09-10Reimplement buildspec parsing to deal with eval contextBoris Kolpackov1-71/+108
In short, in buildspec, parens are treated as operation application rather than eval context unless double-quoted. So in 'clean(foo)' we have the clean operation on target foo while in '"clean(foo)"' we have target cleanfoo. Also, as a bonus, we can now do {clean update}(/long/target/name/).
2015-09-10Fix bug in names() chunking modeBoris Kolpackov1-4/+4
2015-09-10Add support for chunking name parsingBoris Kolpackov1-4/+18
2015-09-09Add support for quoting directive namesBoris Kolpackov1-13/+14
Now only unquoted, literal names are recognized as directives, for example: 'print' = abc print $print
2015-09-09Add initial support for function calls: $func(a b c)Boris Kolpackov1-27/+59
Now it is just a stub that prints the function name and its argument. Currently only single argument can be passed (no value pack support yet).
2015-09-09Add support for evaluation contextBoris Kolpackov1-65/+120
For now it acts as just the value mode that can be enabled anywhere variable expansion is supported, for example: (foo=bar): And the primary use currently is to enable/test quoted and indirect variable expansion: "foo bar" = FOO BAR print $"foo bar" # Invalid. print $("foo bar") # Yeah, baby. foo = FOO FOO = foo print $($foo) Not that you should do something like this...
2015-09-08Use mode stack in lexerBoris Kolpackov1-1/+1
2015-09-08Clean up lexer mode logicBoris Kolpackov1-0/+1
2015-09-08Rework diagnostics verbosity, add quiet mode/optionBoris Kolpackov1-7/+7
2015-09-04Fix clang warningsBoris Kolpackov1-2/+0
2015-08-31Clean parser implementationBoris Kolpackov1-52/+13
2015-08-31Rework scoping logicBoris Kolpackov1-53/+107
Now the src directory is entered into the scope map and points to the same scope as out. This means that targets that are in src, not out (e.g., source files) will "see" rules, variables, etc. This becomes important when we try, for example, to install a source file (say, a header) from src: we need the rule as well as the install.* variables.
2015-08-27Dist module/meta-operation initial implementationBoris Kolpackov1-0/+31
2015-08-24Cosmetic changeBoris Kolpackov1-1/+1
2015-08-24Only treat name as directory if it is reversibleBoris Kolpackov1-22/+32
2015-08-24New variable architectureBoris Kolpackov1-50/+36
2015-07-31Essential install module functionalityBoris Kolpackov1-5/+5
2015-07-15Implement project-qualified names/prerequisites, two-stage importBoris Kolpackov1-20/+96
2015-07-13Add support for pair-enabled variablesBoris Kolpackov1-20/+16
2015-07-07Relax requirement on amalgamation src_root to track sub-projectBoris Kolpackov1-32/+32
2015-07-07Rework module architectureBoris Kolpackov1-10/+4
Now the target type and rule maps are in scopes (builtins -- in global scope). We also now have the map of loaded modules in the root scope of each project.
2015-05-22Get rid of gcc, clang warnings (-Wall)Boris Kolpackov1-1/+0
2015-05-11Correct copyrightBoris Kolpackov1-1/+1
2015-04-29Add support for setting target-specific variables from buildfilesBoris Kolpackov1-92/+140
2015-04-28Remove sourcing triggers support for nowBoris Kolpackov1-21/+0
2015-04-28Second iteration over import/export supportBoris Kolpackov1-24/+32
2015-04-20Merge config.cxx.* variables into cxx.* when loading cxx moduleBoris Kolpackov1-3/+12
2015-04-20Automatically decide when to print relative/absolute pathsBoris Kolpackov1-1/+1
2015-04-17Add support for target groups, use to handle obj/obja/objso object targetsBoris Kolpackov1-2/+2
2015-04-15New variables architectureBoris Kolpackov1-11/+11
Now operator[] is only used for lookup.
2015-04-13Add separate type to represent directory pathsBoris Kolpackov1-26/+26
2015-04-13Add initial import supportBoris Kolpackov1-83/+133