@@ -269,7 +269,7 @@ class IntEx{
269
269
this . emitting = [ ]
270
270
this . symcounter = 0
271
271
272
- const lines = text . replaceAll ( / \/ \/ .* $ / gm, "" ) . match ( / ( ^ | (?< = \; ) ) [ ^ ; ] * \w [ ^ ; ] * ( $ | (? = ; ) ) / gm) . map ( s => {
272
+ const lines = text . replaceAll ( / \/ \/ .* $ / gm, "" ) . match ( / ( ^ | (?< = \; ) ) [ ^ ; \n ] * \w [ ^ ; \n ] * ( $ | (? = ; ) ) / gm) . map ( s => {
273
273
let str = s . replaceAll ( / \s / g, "" )
274
274
for ( let [ sub , tok ] of allreps ) {
275
275
str = str . replaceAll ( sub , tok ) ;
@@ -459,9 +459,9 @@ const qcomp=(ex, bits=8)=>{
459
459
let a = new IntEx ( ex ) ;
460
460
let b = a . compileout ( ) ;
461
461
if ( b [ 1 ] >= 256 ) throw Error ( "Your program needs more than 256 registers. Please wait for 16-bit support." ) ;
462
- let header = new Uint32Array ( [ 1 , a . using . length , b [ 1 ] , 0 , 0 ] )
463
- let c = [ header ]
464
- let offset = 20 ;
462
+ let header = new Uint16Array ( [ 1 , a . using . length , b [ 1 ] , 0 ] )
463
+ let c = [ header , new Uint32Array ( [ b [ 0 ] . byteLength ] ) ]
464
+ let offset = 12 ;
465
465
a . using . forEach ( ( [ x , s ] ) => {
466
466
x = x . substring ( 1 )
467
467
c . push ( new Uint8Array ( [ x . length ] ) ) ;
@@ -472,7 +472,16 @@ const qcomp=(ex, bits=8)=>{
472
472
} )
473
473
c . push ( b [ 0 ] )
474
474
header [ 3 ] = offset ;
475
- header [ 4 ] = b [ 0 ] . byteLength ;
476
- console . log ( c ) ;
475
+ console . log ( c , b_cc ( ...c ) ) ;
477
476
return toB64 ( b_cc ( ...c ) ) ;
478
477
}
478
+
479
+
480
+ p = `
481
+ //example program
482
+ //If 3 divides the channel 'left' and 'right' is greater than 5,
483
+ //store the max. Otherwise, store 10.
484
+
485
+ $someCondition = @left%3==0 && @right>5
486
+ @combine = take($someCondition, 10, max(@left,@right,30))
487
+ `
0 commit comments