aboutsummaryrefslogtreecommitdiff
path: root/crates/ssr/src/parsing.rs
Commit message (Collapse)AuthorAgeFilesLines
* ssr: Allow replacing expressions with statementsMarijn Suijten2021-01-041-3/+13
| | | | | | | | | | | | | | | | | Now that statements can be matched and replaced (#6587) some usecases require expressions to be replaced with statements as well. This happens when something that can ambiguously be an expression or statement like `if` and loop blocks appear in the last position of a block, as trailing expression. In this case a replacement pattern of the form `if foo(){$a();}==>>$a();` will only substitute `if` blocks in the list of statements but not if they (implicitly) end up in the trailing expression, where they are not wrapped by an EXPR_STMT (but the pattern and template are, as parsing only succeeds for the `stmt ==>> stmt` case). Instead of adding two rules that match an expression - and emit duplicate matching errors - allow the template for expressions to be a statement if it fails to parse as an expression.
* syntax,ssr: Implement statement parsingMarijn Suijten2021-01-031-0/+1
|
* Remove more unreachable pubsAleksey Kladov2020-11-021-1/+1
|
* Refactor SSR so that placeholders store a VarDavid Lattimore2020-08-141-5/+19
| | | | | This allows lookup of placeholder bindings given a placeholder without needing to create a Var instance.
* Rename ra_ssr -> ssrAleksey Kladov2020-08-131-0/+389