File tree Expand file tree Collapse file tree 5 files changed +17
-8
lines changed Expand file tree Collapse file tree 5 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 9292 attrs.database{i } = schema .dbname ;
9393 attrs.sqlType{i } = attrs.type{i };
9494 attrs.sqlComment{i } = attrs.comment{i };
95- special = regexp(attrs.comment{i }, ' :([^:]+):(.*)' , ' tokens' );
95+ special = regexp(attrs.comment{i }, ...
96+ ' ^:(?<type>[^: ,()]+):(?<comment>.*)' , ' names' );
9697 if ~isempty(special )
97- attrs.type{i } = special{ 1 }{ 1 } ;
98- attrs.comment{i } = special{ 1 }{ 2 } ;
98+ attrs.type{i } = special . type ;
99+ attrs.comment{i } = special . comment ;
99100 category = dj .internal .Declare .matchType(attrs.type{i });
100101 assert(any(strcmpi(category , dj .internal .Declare .SPECIAL_TYPES )));
101102 else
Original file line number Diff line number Diff line change @@ -147,10 +147,14 @@ function envVarUpdate()
147147 % return STATE prior to change
148148 out = STATE ;
149149 if any(strcmpi(operation , {' set' , ' load' }))
150- % merge with existing STATE
151- STATE = rmfield(STATE , intersect(fieldnames(STATE ), fieldnames(new )));
152- names = [fieldnames(STATE ); fieldnames(new )];
153- STATE = orderfields(cell2struct([struct2cell(STATE ); struct2cell(new )], names , 1 ));
150+ if isempty(STATE )
151+ STATE = new ;
152+ else
153+ % merge with existing STATE
154+ STATE = rmfield(STATE , intersect(fieldnames(STATE ), fieldnames(new )));
155+ names = [fieldnames(STATE ); fieldnames(new )];
156+ STATE = orderfields(cell2struct([struct2cell(STATE ); struct2cell(new )], names , 1 ));
157+ end
154158 if strcmpi(operation , ' load' )
155159 envVarUpdate();
156160 end
Original file line number Diff line number Diff line change 22--------------------------
33* Bugfix: Error on accessing unmanaged Imported/Computed tables (#336) PR #338
44* Bugfix: Certain characters in attribute comment not escaped properly (#210, #335) PR #338
5+ * Bugfix: `dj.config.load(...) ` after initial MATLAB boot throws invalid input error. PR #338
56
673.4.0 -- December 11, 2020
78--------------------------
Original file line number Diff line number Diff line change @@ -197,6 +197,9 @@ function TestConfig_testLoad(testCase)
197197 base = regexprep(base ,' [a-z0-9][A-Z]' ,' ${$0(1)}_${lower($0(2))}' );
198198 TestConfig .TestConfig_configSingleFileTest(testCase , ' load-custom' , ...
199199 [pkg_path ' /test_schemas/config_lite.json' ], jsondecode(base ));
200+ % test load on launch MATLAB
201+ clear functions ;
202+ dj .config .load([pkg_path ' /test_schemas/config_lite.json' ]);
200203 % cleanup
201204 dj .config .restore ;
202205 end
Original file line number Diff line number Diff line change 22# Message
33msg_id : uuid # (this) is: a test of 'an' (elaborate), /type: of "comment" (good luck?)
44---
5- body : varchar(30)
5+ body : varchar(30) # (try) with: double colon (to), throw: it (off)
66dep_id=null : uuid
77%}
88classdef Message < dj .Manual
You can’t perform that action at this time.
0 commit comments