This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ignore_for_file: prefer_conditional_assignment, prefer_final_locals | |
| import 'dart:math' as math; | |
| void main() { | |
| final data = <(String, Map<String, num>, Map<String, Function>)>[ | |
| ('1 + -10.25e2', {}, {}), | |
| ('1 + a * 3', {'a': 2}, {}), | |
| ('sin(x)', {'x': 1}, {}), | |
| ('2^2^x', {'x': 2}, {}), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ignore_for_file: prefer_conditional_assignment, prefer_final_locals | |
| void main() { | |
| const source = ' 1 + 2 * 3 + x '; | |
| final result = calc(source, {'x': 5}); | |
| print(result); | |
| } | |
| int calc(String source, Map<String, int> vars) { | |
| final parser = CalcParser(vars); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main(List<String> args) { | |
| final parser = CsvParser(); | |
| final rows = parseString(parser.parseStart, _source); | |
| for (var i = 0; i < rows.length; i++) { | |
| final row = rows[i]; | |
| print('Row #$i'); | |
| print(row); | |
| } | |
| } |