dawn-cmake/src/tint/ast
Ben Clayton ca0b9ef49e [tint][utils] Add more string helpers
Add utils::Split(), utils::Join() for splitting and joining strings with
delimiters.

Add options to SuggestAlternatives().

Add Quote() for surrounding a string with '.

Requires some include shuffling and minor tweaks to other utilities.

Change-Id: If75058e68cd986450fecc0b27bcc9a94c765a665
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/134580
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
2023-05-26 21:20:36 +00:00
..
transform [tint][utils] Add more string helpers 2023-05-26 21:20:36 +00:00
accessor_expression.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
accessor_expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
alias.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
alias.h Move castable into utils. 2023-04-19 23:52:33 +00:00
alias_test.cc Remove `SymbolTable::NameFor` 2023-04-18 19:38:25 +00:00
assignment_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
assignment_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
assignment_statement_test.cc tint: Change all ProgramBuilder literals to 'i' or 'u' suffix 2022-05-05 20:23:40 +00:00
attribute.cc Condense namespaces in tint/ast. 2022-04-07 18:39:35 +00:00
attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
binary_expression.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
binary_expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
binary_expression_test.cc Consistent formatting for Dawn/Tint. 2022-05-01 14:40:55 +00:00
binding_attribute.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
binding_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
binding_attribute_test.cc Rename attribute values. 2022-09-08 01:04:34 +00:00
bitcast_expression.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
bitcast_expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
bitcast_expression_test.cc Remove `SymbolTable::NameFor` 2023-04-18 19:38:25 +00:00
block_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
block_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
block_statement_test.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
bool_literal_expression.cc tint: Optimize sem node lookup 2022-07-18 20:50:02 +00:00
bool_literal_expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
bool_literal_expression_test.cc Consistent formatting for Dawn/Tint. 2022-05-01 14:40:55 +00:00
break_if_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
break_if_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
break_if_statement_test.cc Add break-if support. 2022-10-20 22:45:50 +00:00
break_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
break_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
break_statement_test.cc Consistent formatting for Dawn/Tint. 2022-05-01 14:40:55 +00:00
builtin_attribute.cc tint: Resolve @builtin() args as expressions 2023-02-21 17:33:54 +00:00
builtin_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
builtin_attribute_test.cc Remove `SymbolTable::NameFor` 2023-04-18 19:38:25 +00:00
builtin_texture_helper_test.cc [tint] Change ast::builtin::test to ast::test 2023-05-11 13:03:38 +00:00
builtin_texture_helper_test.h [tint] Change ast::builtin::test to ast::test 2023-05-11 13:03:38 +00:00
call_expression.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
call_expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
call_expression_test.cc tint: Replace all remaining AST types with ast::Type 2023-02-14 13:52:43 +00:00
call_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
call_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
call_statement_test.cc tint: Have ast::CallExpression use ast::Identifier 2023-02-02 15:16:28 +00:00
case_selector.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
case_selector.h Move castable into utils. 2023-04-19 23:52:33 +00:00
case_selector_test.cc [WGSL] Allow default as a case selector 2022-10-19 15:55:02 +00:00
case_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
case_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
case_statement_test.cc tint: Handle @diagnostic on block statements 2023-02-01 23:14:10 +00:00
compound_assignment_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
compound_assignment_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
compound_assignment_statement_test.cc tint: Change all ProgramBuilder literals to 'i' or 'u' suffix 2022-05-05 20:23:40 +00:00
const.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
const.h Move castable into utils. 2023-04-19 23:52:33 +00:00
const_assert.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
const_assert.h Move castable into utils. 2023-04-19 23:52:33 +00:00
const_assert_test.cc tint: Rename 'static_assert' to 'const_assert' 2023-01-24 14:59:43 +00:00
continue_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
continue_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
continue_statement_test.cc Consistent formatting for Dawn/Tint. 2022-05-01 14:40:55 +00:00
diagnostic_attribute.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
diagnostic_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
diagnostic_attribute_test.cc tint: Add two-token form for diagnostics rule names. 2023-04-20 23:51:53 +00:00
diagnostic_control.cc tint: Add two-token form for diagnostics rule names. 2023-04-20 23:51:53 +00:00
diagnostic_control.h tint: Add two-token form for diagnostics rule names. 2023-04-20 23:51:53 +00:00
diagnostic_control_test.cc tint: Add two-token form for diagnostics rule names. 2023-04-20 23:51:53 +00:00
diagnostic_directive.cc tint: Add two-token form for diagnostics rule names. 2023-04-20 23:51:53 +00:00
diagnostic_directive.h Move castable into utils. 2023-04-19 23:52:33 +00:00
diagnostic_directive_test.cc tint: Add two-token form for diagnostics rule names. 2023-04-20 23:51:53 +00:00
diagnostic_rule_name.cc tint: Add two-token form for diagnostics rule names. 2023-04-20 23:51:53 +00:00
diagnostic_rule_name.h tint: Add two-token form for diagnostics rule names. 2023-04-20 23:51:53 +00:00
diagnostic_rule_name_test.cc tint: Add two-token form for diagnostics rule names. 2023-04-20 23:51:53 +00:00
disable_validation_attribute.cc tint: Fix HLSL emission for out-of-order storage / uniform buffers 2023-03-06 15:43:16 +00:00
disable_validation_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
discard_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
discard_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
discard_statement_test.cc Consistent formatting for Dawn/Tint. 2022-05-01 14:40:55 +00:00
enable.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
enable.h Move castable into utils. 2023-04-19 23:52:33 +00:00
enable_test.cc tint: Support multiple extensions per 'enable' 2023-03-15 05:06:57 +00:00
expression.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
extension.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
extension.h Move castable into utils. 2023-04-19 23:52:33 +00:00
float_literal_expression.cc Generic template and forward in stringstream. 2023-03-02 21:28:45 +00:00
float_literal_expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
float_literal_expression_test.cc Convert most remaining usages to utils::StringStream. 2023-02-28 22:22:58 +00:00
for_loop_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
for_loop_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
for_loop_statement_test.cc tint: Support @diagnostic on for loops 2023-03-15 02:44:47 +00:00
function.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
function.h Move castable into utils. 2023-04-19 23:52:33 +00:00
function_test.cc Remove `SymbolTable::NameFor` 2023-04-18 19:38:25 +00:00
group_attribute.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
group_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
group_attribute_test.cc Rename attribute values. 2022-09-08 01:04:34 +00:00
id_attribute.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
id_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
id_attribute_test.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
identifier.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
identifier.h Move castable into utils. 2023-04-19 23:52:33 +00:00
identifier_expression.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
identifier_expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
identifier_expression_test.cc Add an allocator to store the symbol names. 2023-04-18 19:31:21 +00:00
identifier_test.cc Add an allocator to store the symbol names. 2023-04-18 19:31:21 +00:00
if_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
if_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
if_statement_test.cc tint: Support @diagnostic on if statements 2023-03-14 21:11:53 +00:00
increment_decrement_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
increment_decrement_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
increment_decrement_statement_test.cc Consistent formatting for Dawn/Tint. 2022-05-01 14:40:55 +00:00
index_accessor_expression.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
index_accessor_expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
index_accessor_expression_test.cc Consistent formatting for Dawn/Tint. 2022-05-01 14:40:55 +00:00
int_literal_expression.cc Generic template and forward in stringstream. 2023-03-02 21:28:45 +00:00
int_literal_expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
int_literal_expression_test.cc Convert most remaining usages to utils::StringStream. 2023-02-28 22:22:58 +00:00
internal_attribute.cc tint: Fix HLSL emission for out-of-order storage / uniform buffers 2023-03-06 15:43:16 +00:00
internal_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
interpolate_attribute.cc tint: Resolve @interpolate() args as expressions 2023-02-21 21:05:28 +00:00
interpolate_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
interpolate_attribute_test.cc Remove `SymbolTable::NameFor` 2023-04-18 19:38:25 +00:00
invariant_attribute.cc tint: Optimize sem node lookup 2022-07-18 20:50:02 +00:00
invariant_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
let.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
let.h Move castable into utils. 2023-04-19 23:52:33 +00:00
literal_expression.cc tint: Optimize sem node lookup 2022-07-18 20:50:02 +00:00
literal_expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
location_attribute.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
location_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
location_attribute_test.cc Rename attribute values. 2022-09-08 01:04:34 +00:00
loop_statement.cc tint: Support @diagnostic on loop and loop body 2023-03-16 12:21:44 +00:00
loop_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
loop_statement_test.cc tint: Support @diagnostic on loop and loop body 2023-03-16 12:21:44 +00:00
member_accessor_expression.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
member_accessor_expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
member_accessor_expression_test.cc tint/ast: Add AccessorExpression 2023-02-05 12:36:50 +00:00
module.cc tint: Move Switch() to own header 2023-03-09 16:50:19 +00:00
module.h Move castable into utils. 2023-04-19 23:52:33 +00:00
module_clone_test.cc tint: Add two-token form for diagnostics rule names. 2023-04-20 23:51:53 +00:00
module_test.cc Remove `SymbolTable::NameFor` 2023-04-18 19:38:25 +00:00
must_use_attribute.cc Add `@must_use` AST node. 2023-02-21 18:49:40 +00:00
must_use_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
node.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
node.h Move castable into utils. 2023-04-19 23:52:33 +00:00
node_id.h tint/transform: fix PromoteInitializersToLet for constant expressions 2022-12-09 12:34:36 +00:00
override.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
override.h Move castable into utils. 2023-04-19 23:52:33 +00:00
parameter.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
parameter.h Move castable into utils. 2023-04-19 23:52:33 +00:00
phony_expression.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
phony_expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
phony_expression_test.cc Consistent formatting for Dawn/Tint. 2022-05-01 14:40:55 +00:00
pipeline_stage.cc Generic template and forward in stringstream. 2023-03-02 21:28:45 +00:00
pipeline_stage.h Generic template and forward in stringstream. 2023-03-02 21:28:45 +00:00
return_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
return_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
return_statement_test.cc Consistent formatting for Dawn/Tint. 2022-05-01 14:40:55 +00:00
stage_attribute.cc tint: Optimize sem node lookup 2022-07-18 20:50:02 +00:00
stage_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
stage_attribute_test.cc Consistent formatting for Dawn/Tint. 2022-05-01 14:40:55 +00:00
statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
stride_attribute.cc tint: Optimize sem node lookup 2022-07-18 20:50:02 +00:00
stride_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
stride_attribute_test.cc Fixup various warnings in Tint which were accidentally suppressed. 2022-06-29 14:38:15 +00:00
struct.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
struct.h Move castable into utils. 2023-04-19 23:52:33 +00:00
struct_member.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
struct_member.h Move castable into utils. 2023-04-19 23:52:33 +00:00
struct_member_align_attribute.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
struct_member_align_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
struct_member_align_attribute_test.cc Rename attribute values. 2022-09-08 01:04:34 +00:00
struct_member_offset_attribute.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
struct_member_offset_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
struct_member_offset_attribute_test.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
struct_member_size_attribute.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
struct_member_size_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
struct_member_size_attribute_test.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
struct_member_test.cc Remove `SymbolTable::NameFor` 2023-04-18 19:38:25 +00:00
struct_test.cc [tint] Move AST transforms to a subdirectory 2023-05-11 13:10:59 +00:00
switch_statement.cc tint: Support @diagnostic on switch body 2023-03-16 19:48:20 +00:00
switch_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
switch_statement_test.cc tint: Support @diagnostic on switch body 2023-03-16 19:48:20 +00:00
templated_identifier.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
templated_identifier.h Move castable into utils. 2023-04-19 23:52:33 +00:00
templated_identifier_test.cc tint: Fix ICE in ast::TemplatedIdentifier ctor 2023-02-21 22:01:48 +00:00
test_helper.h Move traits into utils. 2023-04-19 16:52:46 +00:00
test_helper_test.cc Remove `SymbolTable::NameFor` 2023-04-18 19:38:25 +00:00
traverse_expressions.h Move traits into utils. 2023-04-19 16:52:46 +00:00
traverse_expressions_test.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
type.cc tint: Replace all remaining AST types with ast::Type 2023-02-14 13:52:43 +00:00
type.h tint: Replace all remaining AST types with ast::Type 2023-02-14 13:52:43 +00:00
type_decl.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
type_decl.h Move castable into utils. 2023-04-19 23:52:33 +00:00
unary_op.cc Generic template and forward in stringstream. 2023-03-02 21:28:45 +00:00
unary_op.h Generic template and forward in stringstream. 2023-03-02 21:28:45 +00:00
unary_op_expression.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
unary_op_expression.h Move castable into utils. 2023-04-19 23:52:33 +00:00
unary_op_expression_test.cc Consistent formatting for Dawn/Tint. 2022-05-01 14:40:55 +00:00
var.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
var.h Move castable into utils. 2023-04-19 23:52:33 +00:00
variable.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
variable.h Move castable into utils. 2023-04-19 23:52:33 +00:00
variable_decl_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
variable_decl_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
variable_decl_statement_test.cc tint::ProgramBuilder: Simplify variable constructors 2022-08-19 17:28:53 +00:00
variable_test.cc Remove `SymbolTable::NameFor` 2023-04-18 19:38:25 +00:00
while_statement.cc tint/ast: Remove move-constructors for AST nodes 2023-03-15 14:09:40 +00:00
while_statement.h Move castable into utils. 2023-04-19 23:52:33 +00:00
while_statement_test.cc tint: Support @diagnostic on while statements 2023-03-15 00:33:38 +00:00
workgroup_attribute.cc tint/ast: Remove unnecessary ast:: prefixes 2023-02-22 00:08:55 +00:00
workgroup_attribute.h Move castable into utils. 2023-04-19 23:52:33 +00:00
workgroup_attribute_test.cc Remove `SymbolTable::NameFor` 2023-04-18 19:38:25 +00:00