field_list.h 796 B

1234567891011121314151617181920212223242526
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #ifndef EXECUTABLE_SEMANTICS_AST_FIELD_LIST_H_
  5. #define EXECUTABLE_SEMANTICS_AST_FIELD_LIST_H_
  6. #include <list>
  7. #include "executable_semantics/ast/expression.h"
  8. namespace Carbon {
  9. // This is used in the parsing of tuples and parenthesized expressions.
  10. struct FieldList {
  11. std::list<std::pair<std::string, Expression*>>* fields;
  12. bool has_explicit_comma = false;
  13. };
  14. auto MakeFieldList(std::list<std::pair<std::string, Expression*>>* fields)
  15. -> FieldList*;
  16. auto MakeConsField(FieldList* e1, FieldList* e2) -> FieldList*;
  17. } // namespace Carbon
  18. #endif // EXECUTABLE_SEMANTICS_AST_FIELD_LIST_H_