Skip to content

Commit 6a125e6

Browse files
committed
Revert "Doc comments: use std::unordered_map"
hash<SourcePath> isn't implemented yet, and I can't cherry-pick a bug-free commit yet. This reverts commit 95529f31e3bbda99111c5ce98a33484dc6e7a462.
1 parent ac89df8 commit 6a125e6

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/libexpr/eval.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ struct Constant
130130
typedef std::map<std::string, Value *> ValMap;
131131
#endif
132132

133-
typedef std::unordered_map<PosIdx, DocComment> DocCommentMap;
133+
typedef std::map<PosIdx, DocComment> DocCommentMap;
134134

135135
struct Env
136136
{
@@ -335,7 +335,7 @@ private:
335335
* Associate source positions of certain AST nodes with their preceding doc comment, if they have one.
336336
* Grouped by file.
337337
*/
338-
std::unordered_map<SourcePath, DocCommentMap> positionToDocComment;
338+
std::map<SourcePath, DocCommentMap> positionToDocComment;
339339

340340
LookupPath lookupPath;
341341

src/libexpr/parser-state.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct LexerState
6464
/**
6565
* @brief Maps some positions to a DocComment, where the comment is relevant to the location.
6666
*/
67-
std::unordered_map<PosIdx, DocComment> & positionToDocComment;
67+
std::map<PosIdx, DocComment> & positionToDocComment;
6868

6969
PosTable & positions;
7070
PosTable::Origin origin;

src/libexpr/parser.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
namespace nix {
5050

51-
typedef std::unordered_map<PosIdx, DocComment> DocCommentMap;
51+
typedef std::map<PosIdx, DocComment> DocCommentMap;
5252

5353
Expr * parseExprFromBuf(
5454
char * text,

0 commit comments

Comments
 (0)