Adam Pippin
0737fcd74a
Add concat/select operators
3 years ago
Adam Pippin
2082f6238a
Add boolean literals to expression parser
3 years ago
Adam Pippin
701b25779e
Allow !replace to accept a scalar
This is the default merge behaviour, but simplifies using !replace because passing in a var that happens to evaluate to a scalar won't cause an issue anymore
3 years ago
Adam Pippin
9e5adfb9ce
Bugfix: !if that creates cfn conditions properly replaces parent node
3 years ago
Adam Pippin
a3fe71526d
Bugfix: generating Fn::If without false caused error
3 years ago
Adam Pippin
9a99fc315b
Bugfix: expression binary operators were dropping children
3 years ago
Adam Pippin
b38a37d048
Update README.md
3 years ago
Adam Pippin
2b619d767b
Remove old expression parser
3 years ago
Adam Pippin
41b26006ac
Cleanup + comments
3 years ago
Adam Pippin
22aa9e068f
Update fn::if to use new expression parser and generate conditions where appropriate
3 years ago
Adam Pippin
f58cd9129d
Add an `addCondition` method to compiler for calling from functions
3 years ago
Adam Pippin
27774c84c6
Expression bug fix replacing variables; add string literal
3 years ago
Adam Pippin
5d0afd4984
Reimplement expression parser
Moving towards something a little more formal -- eventual goal here is that we can evaluate expressions as far as possible given everything available to us at the time and translate the rest into a cloudformation condition
3 years ago
Adam Pippin
01b036b284
Move cfnpp code out from under engine namespace
3 years ago
Adam Pippin
ff0b4515ff
Fix wiki link?
3 years ago
Adam Pippin
a0b446918e
README contents cleaned up and migrated to wiki; remove and link there
3 years ago
Adam Pippin
ce600dd8e7
Add !expr to readme and concat/concat* functions
3 years ago
Adam Pippin
60f8d2be60
Also look at variables referenced in expressions when determining dependencies between variables
3 years ago
Adam Pippin
400542bc12
Specify some functions callable from expressions
3 years ago
Adam Pippin
6485b4f5a1
Add !expr function to allow inserting the result of evaluating an expression
3 years ago
Adam Pippin
a2d5324840
Allow expression evaluator to return an array if stack contains multiple values
3 years ago
Adam Pippin
e490332d7d
Update README -- variables now support all sorts of YAML, not just scalar values
3 years ago
Adam Pippin
4d0b6f58ab
Correct README -- was still referencing upper-cased !Replace
3 years ago
Adam Pippin
26eeb10015
README.md: Motivation
3 years ago
Adam Pippin
d378ad6691
clarify !if false value is optional
3 years ago
Adam Pippin
290c55e317
Update readme with new features (mainly !if); cleared a few thinsg off of TODO
3 years ago
Adam Pippin
d4d457340a
Fix bug in expression string literal parser
3 years ago
Adam Pippin
07e9fc2a3a
Cleanup
3 years ago
Adam Pippin
497f23594e
Add basic !if function
3 years ago
Adam Pippin
6b3eaa6833
First pass at expression parser/evaluator
3 years ago
Adam Pippin
b470283fde
Fix potential bug where using !unset on a variable would result in a crash
3 years ago
Adam Pippin
9f5dda08de
Add compiler pass 2 - run remaining functions
We're now back to where we started functionality-wise!
3 years ago
Adam Pippin
5a1b4f3402
Add compiler pass 1 -- resolve dependencies between variables and evaluate values
3 years ago
Adam Pippin
1cdadf4521
Have dependency graph throw an exception rather than return nothing when no edge nodes are present
3 years ago
Adam Pippin
1fd4bfb2b8
Cleanup
3 years ago
Adam Pippin
0c70de8e8a
Compiler pass 0 using new dependency graph/etc
This gets us back mostly to where we were, sans running non-merge !functions and variable/parameter support
3 years ago
Adam Pippin
9dbe97a3ec
Don't write state information into metadata from engine as all the actual state is now in compiler
3 years ago
Adam Pippin
d167f08e24
Add File::clear() to allow clearing and reusing/modifying file resolver
3 years ago
Adam Pippin
be9857cd2f
Add super rudimentary dependency graph solver
3 years ago
Adam Pippin
145b89da1e
Add generic methods for converting DOM<->PHP, updated places where this is useful
3 years ago
Adam Pippin
1bb3e50cfb
Move cfnpp stuff into its own namespace
3 years ago
Adam Pippin
8722279af6
Remove all logic besides "load files, pass to compiler" from Engine
3 years ago
Adam Pippin
4b26a910af
Have the compiler passed the entire set of documents + state to facilitate moving the higher-level compilation logic into the compiler
We're moving a bunch of the compilation logic building up inside Engine into the compiler
3 years ago
Adam Pippin
f3a3d21a36
Track parameters like variables
Not in love with this. Cannot use !functions in variables/parameters block because they're grabbed before being compiled.
3 years ago
Adam Pippin
f71b5f3582
Rewrite README to explain functionality, move forward TODO list
3 years ago
Adam Pippin
c0b4fd7dd3
Code cleanup
3 years ago
Adam Pippin
300de19fe5
Bugfix: recent list of includes between each file
The one time I don't get lazy and initialize my variables...
3 years ago
Adam Pippin
6ce8dec215
Add !var to use value of variable as value
3 years ago
Adam Pippin
6b8439e3c2
Bugfix: don't try and iterate over the thing we're modifying
3 years ago
Adam Pippin
4056674c1d
Rework Engine::process, handle variables in meta block
3 years ago