Skip to content

Commit

Permalink
replace 'MATHCHAR' with 'MATHCHARS'
Browse files Browse the repository at this point in the history
  • Loading branch information
gfngfn committed Jun 16, 2021
1 parent fe3d27a commit 2d9e7b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/frontend/lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@ and mathexpr stack = parse
| "^" { SUPERSCRIPT(get_pos lexbuf) }
| "_" { SUBSCRIPT(get_pos lexbuf) }
| "'"+ { let n = String.length (Lexing.lexeme lexbuf) in PRIMES(get_pos lexbuf, n) }
| (mathsymboltop (mathsymbol*)) { MATHCHAR(get_pos lexbuf, Lexing.lexeme lexbuf) }
| mathstr+ { MATHCHAR(get_pos lexbuf, Lexing.lexeme lexbuf) }
| (mathsymboltop (mathsymbol*)) { MATHCHARS(get_pos lexbuf, Lexing.lexeme lexbuf) }
| mathstr+ { MATHCHARS(get_pos lexbuf, Lexing.lexeme lexbuf) }
| ("#" (identifier as varnm)) {
VARINMATH(get_pos lexbuf, [], varnm)
}
Expand All @@ -577,7 +577,7 @@ and mathexpr stack = parse
}
| ("\\" symbol) {
let tok = String.sub (Lexing.lexeme lexbuf) 1 1 in
MATHCHAR(get_pos lexbuf, tok)
MATHCHARS(get_pos lexbuf, tok)
}
| _ as c { report_error lexbuf ("illegal token '" ^ (String.make 1 c) ^ "' in a math area") }

Expand Down
6 changes: 4 additions & 2 deletions src/frontend/parser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
%token <Range.t * string * bool * bool> LITERAL
%token <Range.t * Types.input_position * string> POSITIONED_LITERAL
%token <Range.t> SPACE BREAK
%token <Range.t * string> MATHCHAR
%token <Range.t * string> MATHCHARS
%token <Range.t * int> PRIMES
%token <Range.t> SUBSCRIPT SUPERSCRIPT
%token <Range.t> LAMBDA ARROW COMMAND
Expand Down Expand Up @@ -1120,7 +1120,9 @@ mathgroup:
| utm=mathbot { utm }
;
mathbot:
| tok=MATHCHAR { let (rng, char) = tok in (rng, UTMChar(char)) }
| tok=MATHCHARS {
let (rng, s) = tok in (rng, UTMChar(s))
}
| mcmd=mcmd; arglst=list(matharg) {
let (rngcmd, mdlnmlst, csnm) = mcmd in
let rnglast =
Expand Down

0 comments on commit 2d9e7b7

Please sign in to comment.