Skip to content

Commit f1b6b09

Browse files
committed
Update parse-formula-intermediate-representation.typ
1 parent 1917c24 commit f1b6b09

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/parse-formula-intermediate-representation.typ

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
#let patterns = (
99
element: regex(
1010
"^([A-Z][a-z]?)" +
11-
"(?:(_?\\d+)|(\\^\\.?[+-]?\\d+[+-]?|\\^\\.?[+-.]{1}|\\^?[+-]?[IV]+|\\.?[+-]{1}\\d?))?" +
12-
"(?:(_?\\d+)|(\\^\\.?[+-]?\\d+[+-]?|\\^\\.?[+-.]{1}|\\^?[+-]?[IV]+|\\.?[+-]{1}\\d?))?" +
13-
"(\\^\\^[+-]?(?:[IViv]{1,3}|\\d+))?"
11+
"(?:(_?\d+)|(\^\.?[+-]?\d+[+-]?|\^\.?[+-.]{1}|\^?[+-]?[IV]+|\.?[+-]{1}\d?))?" +
12+
"(?:(_?\d+)|(\^\.?[+-]?\d+[+-]?|\^\.?[+-.]{1}|\^?[+-]?[IV]+|\.?[+-]{1}\d?))?" +
13+
"(\^\^[+-]?(?:[IViv]{1,3}|\d+))?"
1414
),
1515
group: regex(
16-
"^((?:\\([^()]*(?:\\([^()]*\\)[^()]*)*\\))|(?:\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\})|(?:\\[[^\\[\\]]*(?:\\[[^\\[\\]]*\\][^\\[\\]]*)*\\]))" +
17-
"(?:(_?\\d+)|(\\^\\.?[+-]?\\d+[+-]?|\\^\\.?[+-.]{1}|[+-]{1}\\d?))?" +
18-
"(?:(_?\\d+)|(\\^\\.?[+-]?\\d+[+-]?|\\^\\.?[+-.]{1}|[+-]{1}\\d?))?"
16+
"^((?:\([^()]*(?:\([^()]*\)[^()]*)*\))|(?:\{[^{}]*(?:\{[^{}]*\}[^{}]*)*\})|(?:\[[^\[\]]*(?:\[[^\[\]]*\][^\[\]]*)*\]))" +
17+
"(?:(_?\d+)|(\^\.?[+-]?\d+[+-]?|\^\.?[+-.]{1}|[+-]{1}\d?))?" +
18+
"(?:(_?\d+)|(\^\.?[+-]?\d+[+-]?|\^\.?[+-.]{1}|[+-]{1}\d?))?"
1919
),
20-
reaction-plus: regex("^\\s*\\+\\s*"),
20+
reaction-plus: regex("^\s*\+\s*"),
2121
reaction-arrow: regex(
22-
"^\\s*(<->|↔|<=>|⇔|->|→|<-|←|=>|⇒|<=|⇐|-/?\\>|</-)" +
23-
"(?:\\[([^\\[\\]]*)\\])?" +
24-
"(?:\\[([^\\[\\]]*)\\])?" +
25-
"\\s*"
22+
"^\s*(<->|↔|<=>|⇔|->|→|<-|←|=>|⇒|<=|⇐|-/?\>|</-)" +
23+
"(?:\[([^\[\]]*)\])?" +
24+
"(?:\[([^\[\]]*)\])?" +
25+
"\s*"
2626
),
27-
math: regex("^\\$[^$]*?\\$"),
28-
state: regex("^\\((s|l|g|aq|solid|liquid|gas|aqueous|aqua)\\)"),
27+
math: regex("^\$[^$]*?\$"),
28+
state: regex("^\((s|l|g|aq|solid|liquid|gas|aqueous|aqua)\)"),
2929
)
3030

3131
#let get-count-and-charge(count1, count2, charge1, charge2) = {

0 commit comments

Comments
 (0)