@@ -100,7 +100,7 @@ function validateNode(
100100 errors . push (
101101 new ParseError (
102102 `Common attr '${ ca . name } ' conflicts with per-type attr on ${ typeKey } ` ,
103- { code : "ERR_PROVIDER_ATTR_CONFLICT" } ,
103+ { code : "ERR_PROVIDER_ATTR_CONFLICT" , source : node . source } ,
104104 ) ,
105105 ) ;
106106 reportedConflicts . add ( typeKey ) ;
@@ -126,7 +126,7 @@ function validateNode(
126126 errors . push (
127127 new ParseError (
128128 `${ nodeLabel ( node ) } is missing required attribute '@${ spec . name } '` ,
129- { code : "ERR_MISSING_REQUIRED_ATTR" } ,
129+ { code : "ERR_MISSING_REQUIRED_ATTR" , source : node . source } ,
130130 ) ,
131131 ) ;
132132 }
@@ -145,7 +145,7 @@ function validateNode(
145145 const valueErrors = inst . validateValue ( value ) ;
146146 if ( valueErrors . length > 0 ) {
147147 for ( const ve of valueErrors ) {
148- errors . push ( new ParseError ( `${ nodeLabel ( node ) } ${ ve . message } ` , { code : "ERR_BAD_ATTR_VALUE" } ) ) ;
148+ errors . push ( new ParseError ( `${ nodeLabel ( node ) } ${ ve . message } ` , { code : "ERR_BAD_ATTR_VALUE" , source : node . source } ) ) ;
149149 }
150150 continue ; // type wrong → skip allowedValues
151151 }
@@ -159,7 +159,7 @@ function validateNode(
159159 `${ nodeLabel ( node ) } attribute '@${ inst . name } ' has value ` +
160160 `'${ String ( value ) } ' which is not one of the allowed values: ` +
161161 `${ spec . allowedValues . map ( ( v ) => String ( v ) ) . join ( ", " ) } ` ,
162- { code : "ERR_BAD_ATTR_VALUE" } ,
162+ { code : "ERR_BAD_ATTR_VALUE" , source : node . source } ,
163163 ) ,
164164 ) ;
165165 }
@@ -180,7 +180,7 @@ function validateNode(
180180 errors . push (
181181 new ParseError (
182182 `${ nodeLabel ( node ) } must declare at least one value in '@${ FIELD_ATTR_VALUES } '.` ,
183- { code : "ERR_BAD_ATTR_VALUE" } ,
183+ { code : "ERR_BAD_ATTR_VALUE" , source : node . source } ,
184184 ) ,
185185 ) ;
186186 } else {
@@ -194,14 +194,14 @@ function validateNode(
194194 `${ nodeLabel ( node ) } attribute '@${ FIELD_ATTR_VALUES } ' member '${ member } ' ` +
195195 `is not a valid identifier (must match ${ ENUM_MEMBER_PATTERN . source } ). ` +
196196 `Non-identifier-safe member strings require a symbol↔value mapping (deferred).` ,
197- { code : "ERR_BAD_ATTR_VALUE" } ,
197+ { code : "ERR_BAD_ATTR_VALUE" , source : node . source } ,
198198 ) ,
199199 ) ;
200200 } else if ( seen . has ( member ) ) {
201201 errors . push (
202202 new ParseError (
203203 `${ nodeLabel ( node ) } attribute '@${ FIELD_ATTR_VALUES } ' has duplicate member '${ member } '.` ,
204- { code : "ERR_BAD_ATTR_VALUE" } ,
204+ { code : "ERR_BAD_ATTR_VALUE" , source : node . source } ,
205205 ) ,
206206 ) ;
207207 } else {
0 commit comments