mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 13:29:11 +00:00 
			
		
		
		
	patch js for fnptr
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
		
							parent
							
								
									14214c5a07
								
							
						
					
					
						commit
						1e586888c9
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
					@ -86,7 +86,7 @@ for (let file of files) {
 | 
				
			||||||
  let apiLines = contents.split('\n').filter(l => /def_API|extra_API/.test(l));
 | 
					  let apiLines = contents.split('\n').filter(l => /def_API|extra_API/.test(l));
 | 
				
			||||||
  for (let line of apiLines) {
 | 
					  for (let line of apiLines) {
 | 
				
			||||||
    let match = line.match(
 | 
					    let match = line.match(
 | 
				
			||||||
      /^\s*(?<def>def_API|extra_API) *\(\s*'(?<name>[A-Za-z0-9_]+)'\s*,\s*(?<ret>[A-Za-z0-9_]+)\s*,\s*\((?<params>((_in|_out|_in_array|_out_array|_inout_array)\([^)]+\)\s*,?\s*)*)\)\s*\)\s*$/,
 | 
								   /^\s*(?<def>def_API|extra_API) *\(\s*'(?<name>[A-Za-z0-9_]+)'\s*,\s*(?<ret>[A-Za-z0-9_]+)\s*,\s*\((?<params>((_in|_out|_in_array|_out_array|_fnptr|_inout_array)\([^)]+\)\s*,?\s*)*)\)\s*\)\s*$/,
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
    if (match == null) {
 | 
					    if (match == null) {
 | 
				
			||||||
      throw new Error(`failed to match def_API call ${JSON.stringify(line)}`);
 | 
					      throw new Error(`failed to match def_API call ${JSON.stringify(line)}`);
 | 
				
			||||||
| 
						 | 
					@ -97,11 +97,12 @@ for (let file of files) {
 | 
				
			||||||
    let parsedParams = [];
 | 
					    let parsedParams = [];
 | 
				
			||||||
    while (true) {
 | 
					    while (true) {
 | 
				
			||||||
      text = eatWs(text);
 | 
					      text = eatWs(text);
 | 
				
			||||||
      ({ text, match } = eat(text, /^_(?<kind>in|out|in_array|out_array|inout_array)\(/));
 | 
					      ({ text, match } = eat(text, /^_(?<kind>in|out|in_array|out_array|inout_array|fnptr)\(/));
 | 
				
			||||||
      if (match == null) {
 | 
					      if (match == null) {
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      let kind = match.groups.kind;
 | 
					      let kind = match.groups.kind;
 | 
				
			||||||
 | 
					      if (kind == 'fnptr') kind = 'in_array'
 | 
				
			||||||
      if (kind === 'inout_array') kind = 'in_array'; // https://github.com/Z3Prover/z3/discussions/5761
 | 
					      if (kind === 'inout_array') kind = 'in_array'; // https://github.com/Z3Prover/z3/discussions/5761
 | 
				
			||||||
      if (kind === 'in' || kind === 'out') {
 | 
					      if (kind === 'in' || kind === 'out') {
 | 
				
			||||||
        ({ text, match } = expect(text, /^[A-Za-z0-9_]+/));
 | 
					        ({ text, match } = expect(text, /^[A-Za-z0-9_]+/));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue