File tree Expand file tree Collapse file tree 7 files changed +12
-10
lines changed
Expand file tree Collapse file tree 7 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ all: compile.js
22 npm install
33 node lambda -h
44 node lambda -ce " S hello bye world"
5- node lambda -d debug.mlc
6- node lambda -pt fact.mlc
5+ node lambda -d samples/ debug.mlc
6+ node lambda -pt samples/ fact.mlc
77
88compile.js : grammar.jison
99 npm install jison@0.4.15
Original file line number Diff line number Diff line change 22
33const encode = require ( "./encoding" ) ;
44const compile = require ( "./compile" ) ;
5+ const samples = require ( "./samples" ) ;
56const inet = require ( "inet-lib" ) ;
6- const fs = require ( "fs" ) ;
7- const path = require ( "path" ) ;
87
98const parser = new compile . Parser ( ) ;
10- const example = fs . readFileSync ( path . join ( __dirname , "fact.mlc" ) , "utf8" ) ;
119let expanded ;
1210
1311function obj2mlc ( obj )
@@ -112,6 +110,7 @@ run.debug = debug;
112110run . debug0 = debug0 ;
113111run . debug1 = debug1 ;
114112run . mlc2in = mlc2in ;
115- run . example = example . replace ( / \n * $ / , "" ) ;
113+ run . example = samples . fact . replace ( / \n * $ / , "" ) ;
114+ run . samples = samples ;
116115
117116module . exports = run ;
Original file line number Diff line number Diff line change 44
55const lambda = require ( "." ) ;
66const yargs = require ( "yargs" ) ;
7- const path = require ( "path" ) ;
87const fs = require ( "fs" ) ;
98
109const opts = {
@@ -52,15 +51,13 @@ const argv = yargs
5251 . wrap ( 70 )
5352 . argv ;
5453
55- const comb = fs . readFileSync ( path . join ( __dirname , "helper.txt" ) , "utf8" ) ;
56-
5754let input = argv . _ [ 0 ] ;
5855
5956if ( ! argv . expr )
6057 input = fs . readFileSync ( input , "utf8" ) ;
6158
6259if ( argv . comb )
63- input = comb . concat ( input ) ;
60+ input = lambda . samples . helper . concat ( input ) ;
6461
6562if ( argv . debug ) {
6663 let eqn ;
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1+ const fs = require ( "fs" ) ;
2+ const path = require ( "path" ) ;
3+
4+ exports . debug = fs . readFileSync ( path . join ( __dirname , "debug.mlc" ) , "utf8" ) ;
5+ exports . fact = fs . readFileSync ( path . join ( __dirname , "fact.mlc" ) , "utf8" ) ;
6+ exports . helper = fs . readFileSync ( path . join ( __dirname , "helper.txt" ) , "utf8" ) ;
You can’t perform that action at this time.
0 commit comments