@@ -790,11 +790,6 @@ export class Compiler {
790790 // (global $~lib/rt/stub/offset (mut i32) (i32.const 0))
791791 // (global $~lib/native/ASC_RUNTIME i32 (i32.const 0))
792792 // (global $runtime/ohmRuntime/bindings (mut i32) (i32.const 0))
793- // (global $runtime/ohmRuntime/preallocAlnum1 (mut i32) (i32.const 0))
794- // (global $runtime/ohmRuntime/preallocAny1 (mut i32) (i32.const 0))
795- // (global $runtime/ohmRuntime/preallocLetter1 (mut i32) (i32.const 0))
796- // (global $runtime/ohmRuntime/preallocLower1 (mut i32) (i32.const 0))
797- // (global $runtime/ohmRuntime/preallocUpper1 (mut i32) (i32.const 0))
798793 // (global $~lib/memory/__heap_base i32 (i32.const 1179884))
799794 asm . addGlobal ( 'pos' , w . valtype . i32 , w . mut . var , ( ) => asm . i32Const ( 0 ) ) ;
800795 asm . addGlobal ( 'rightmostFailurePos' , w . valtype . i32 , w . mut . var , ( ) => asm . i32Const ( - 1 ) ) ;
@@ -806,11 +801,6 @@ export class Compiler {
806801 asm . addGlobal ( '__offset' , w . valtype . i32 , w . mut . var , ( ) => asm . i32Const ( 0 ) ) ;
807802 asm . addGlobal ( '__ASC_RUNTIME' , w . valtype . i32 , w . mut . const , ( ) => asm . i32Const ( 0 ) ) ;
808803 asm . addGlobal ( 'bindings' , w . valtype . i32 , w . mut . var , ( ) => asm . i32Const ( 0 ) ) ;
809- asm . addGlobal ( 'preallocAlnum1' , w . valtype . i32 , w . mut . var , ( ) => asm . i32Const ( 0 ) ) ;
810- asm . addGlobal ( 'preallocAny1' , w . valtype . i32 , w . mut . var , ( ) => asm . i32Const ( 0 ) ) ;
811- asm . addGlobal ( 'preallocLetter1' , w . valtype . i32 , w . mut . var , ( ) => asm . i32Const ( 0 ) ) ;
812- asm . addGlobal ( 'preallocLower1' , w . valtype . i32 , w . mut . var , ( ) => asm . i32Const ( 0 ) ) ;
813- asm . addGlobal ( 'preallocUpper1' , w . valtype . i32 , w . mut . var , ( ) => asm . i32Const ( 0 ) ) ;
814804 asm . addGlobal ( '__heap_base' , w . valtype . i32 , w . mut . var , ( ) => asm . i32Const ( 67240172 ) ) ;
815805
816806 // Reserve a fixed number of imports for debug labels.
@@ -833,14 +823,8 @@ export class Compiler {
833823 const { grammar} = this ;
834824
835825 const lookUpRule = name => {
836- const isSyntactic = isSyntacticRule ( name ) ;
837- if ( name in grammar . rules ) {
838- return { ...grammar . rules [ name ] , isSyntactic} ;
839- }
840- // if (grammar.superGrammar) {
841- // console.log('going to supergrammar');
842- // return lookUpRule(name, grammar.superGrammar);
843- // }
826+ assert ( name in grammar . rules ) ;
827+ return { ...grammar . rules [ name ] , isSyntactic : isSyntacticRule ( name ) } ;
844828 } ;
845829
846830 // Begin with all the rules in the grammar + all "special" rules.
@@ -1666,35 +1650,6 @@ export class Compiler {
16661650 asm . incPos ( ) ;
16671651 } ) ;
16681652 }
1669-
1670- emitSingleCharFastPath ( ruleName ) {
1671- const { asm} = this ;
1672- this . maybeEmitSpaceSkipping ( ) ;
1673-
1674- const caseCb = ( i , depth ) => {
1675- const c = String . fromCharCode ( i ) ;
1676- if (
1677- ruleName === 'alnum' &&
1678- ( ( 'A' <= c && c <= 'Z' ) || ( 'a' <= c && c <= 'z' ) || ( '0' <= c && c <= '9' ) )
1679- ) {
1680- asm . callPrebuiltFunc ( 'pushPreallocAlnum' ) ;
1681- // asm.newTerminalNodeWithSavedPos();
1682- asm . localSet ( 'ret' ) ;
1683- asm . break ( depth + 1 ) ;
1684- } else {
1685- asm . setRet ( 0 ) ;
1686- asm . break ( depth + 1 ) ;
1687- }
1688- } ;
1689- asm . emit ( 'fastpath' ) ;
1690- asm . switch (
1691- w . blocktype . empty ,
1692- ( ) => asm . nextCharCode ( ) ,
1693- 128 ,
1694- caseCb ,
1695- ( ) => { } ,
1696- ) ;
1697- }
16981653}
16991654
17001655// Memory layout:
0 commit comments