Commit Graph

35 Commits

Author SHA1 Message Date
Gitea
9468b657d2 Run cargo fmt. 2018-12-16 17:40:25 -05:00
Gitea
c74cd90d8e Handle mixed spaces and tabs.
This allows the parser to handle tabs and spaces. Currently it
requires that spaces come after any tabs, which is slightly more
strict than python3. It also requires that neighboring indentation
levels have either both more spaces and tabs or less spaces and
tabs so that tab size can't make perception of indentation
differ from what the parser interprets.

I didn't opt to implement PartialOrd on IndentationLevel because I
wasn't sure that the comparison logic would meet the logical
requirements for that trait. One could easily switch to having it
implement PartialOrd though. This would necessitate switching to
manually implementing PartialEq so that it's behavior 'matches'.
It's unclear from the docs what 'matches' exactly means so for
now I'm avoiding implementing the traits.
2018-12-16 17:11:37 -05:00
Windel Bouwman
99af466a88 Move max function test cases to snippet dir. Implement key and default argument on max function. 2018-11-07 17:26:18 +01:00
Windel Bouwman
17fc5a2345 Implemented hexadecimal, octal and binary literals. Also use bigint in the lexer to store big integer literals. 2018-11-04 09:00:44 +01:00
Windel Bouwman
079905277b Add time module and improve lexer handling of numeric constants 2018-11-03 15:12:12 +01:00
Windel Bouwman
b7a0b0f2f3 Removal of ToRust trait to prevent incorrect str representation 2018-11-02 20:27:05 +01:00
Windel Bouwman
5053d6d167 Add bytes literal support. 2018-10-28 21:15:46 +01:00
Windel Bouwman
4187a6ee39 Add support for star expanded argument in list and tuple constructions. 2018-10-28 14:16:11 +01:00
Windel Bouwman
a3a427c252 Add 'yield from' syntax 2018-10-27 17:05:22 +02:00
Windel Bouwman
b03dd623c7 Add raw strings to lexer. Add line break continuation to lexer. 2018-10-27 10:30:11 +02:00
Windel Bouwman
c94c5f7049 Add keyword module 2018-10-10 19:40:52 +02:00
Windel Bouwman
3f7986c811 Address review comments 2018-08-26 22:01:00 +02:00
Windel Bouwman
96ee1cce60 Add filename and row to traceback 2018-08-26 12:17:16 +02:00
Daniel Watkins
159a524f3f Don't double-count newlines in comments
lex_comment doesn't consume the newlines, (correctly) leaving them to
the regular newline parsing.  As such, it shouldn't call self.new_line,
or we end up double-counting lines.
2018-08-25 10:54:31 -04:00
Daniel Watkins
a06044dc6b Reject newlines in single-quoted strings 2018-08-25 00:21:37 -04:00
Daniel Watkins
367806f845 Increment lexer row count for newlines in strings 2018-08-25 00:20:03 -04:00
Windel Bouwman
4897e10714 Add location to statement ast type 2018-08-22 16:18:47 +02:00
Windel Bouwman
f6edf876fd Some formatting 2018-08-22 13:08:07 +02:00
Windel Bouwman
3d9b2360e3 Add row and column info to lexer 2018-08-22 12:14:37 +02:00
Windel Bouwman
823730f023 Fix cast test snippet 2018-08-20 21:37:21 +02:00
Windel Bouwman
15e274210f Add float type 2018-08-20 21:22:14 +02:00
Daniel Watkins
2a90df80c8 Run cargo fmt to format the entire project 2018-08-10 20:23:15 -04:00
Daniel Watkins
76a19d35be Move lexer::lex_source in to tests module
That's the only place it is used; this fixes a warning.
2018-08-10 17:10:42 -04:00
Daniel Watkins
3861fd898e Implement triple-quotes for strings
This fixes #33.
2018-08-08 23:36:32 -04:00
Daniel Watkins
3e56bc1d60 Include numbers in valid identifier characters
Fixes #27.
2018-08-04 16:00:15 -04:00
Windel Bouwman
099595bf17 Merge pull request #15 from wulmer/feature/windows-and-mac-eol-characters
Add support for Windows/Mac EOL characters in lexer
2018-07-29 17:15:49 +02:00
Adam Kelly
12a3ff5e7e Deal with warnings for Ellipsis and Rarrow 2018-07-29 09:06:56 +01:00
Ulmer Wolfgang (CR/AEE3)
d168156375 Add support for Windows/Mac EOL characters in lexer 2018-07-28 22:00:46 +01:00
Adam Kelly
a6785c8d72 Add support for a escape sequence in string literals to lexer.
(\u, \x and octals not supported.)
2018-07-27 10:43:48 +01:00
Windel Bouwman
e47e5f3d05 Add else statement 2018-07-15 16:54:29 +02:00
Windel Bouwman
b653b96a46 Autoformatting 2018-07-15 13:16:00 +02:00
Windel Bouwman
8a0d8ab624 Add += and -= 2018-07-15 10:58:20 +02:00
Windel Bouwman
36bef81ceb Change eval compile to statement 2018-07-14 16:03:50 +02:00
Windel Bouwman
ed4557fec5 Added cool script to test snippets in both implementations 2018-07-08 19:57:53 +02:00
Windel Bouwman
4be77bcbc7 Remove unused compiler namespace in parser 2018-07-07 17:36:21 +02:00