+import * as util from 'util';
var fs = require('fs');
* SEMI_C// semi-colon
*/
export enum TokenType {
- NL, // newlinw
+ NL, // newline
SP, // half-width space and tab
ID, // identifier
STR, // string
* @param s the checker string.
* @returns `None` or matched pair wrapped in `Some`
*/
- export function matchWord(s: string, ): (m: MatcheePair) => Maybe<MatcheePair> {
+export function matchWord(s: string, ): (m: MatcheePair) => Maybe<MatcheePair> {
return (m)=>{
if (s.length==0){
return { _tag: "None" };
// space = [ \t]+
let space = bTerm((x: Maybe<MatcheePair>) =>
thenDo(thenDo(x, s_aux), zeroOrMoreDo(s_aux)),
- TokenType.INT);
+ TokenType.SP);
// newline = \r?\n
let newline = bTerm((x: Maybe<MatcheePair>) =>