Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String spaces #48

Merged
merged 5 commits into from
May 23, 2024
Merged

String spaces #48

merged 5 commits into from
May 23, 2024

Conversation

sowmith1999
Copy link
Member

Modified ast.h to add a new token type for string, char type for quotes,
and a parse state for string.
Modified get_char_type and get_token to support spaces in strings

(edge "well string")
(edge "well another string)")
(edge "yet another ! ? string")

Goes through successfully

Updated repl_and_runslog.md.

Modified ast.h to add a new token type for string, char type for quotes,
and a parse state for string.
Modified get_char_type and get_token to support spaces in strings
```slog
(edge "well string")
(edge "well another string)")
(edge "yet another ! ? string")
```
Goes through succesfully
@sowmith1999 sowmith1999 requested a review from StarGazerM May 15, 2024 03:00
@StarGazerM
Copy link
Contributor

can you add a CI case for this?

```slog
; Strings with spaces
(strs 1 "well string")
(strs 2 "well another string)")
(strs 3 "yet another ! ? string")

[(strs _ str_val) --> (just_str str_val)]
```
Goes Through.
@sowmith1999
Copy link
Member Author

sowmith1999 commented May 15, 2024

@StarGazerM
Added this simple test, Please let me know if you have any suggestions for a more comprehensive test.

; Strings with spaces
(strs 1 "well string")
(strs 2 "well another string)")
(strs 3 "yet another ! ? string")

[(strs _ str_val) --> (just_str str_val)]

@StarGazerM
Copy link
Contributor

can you add the testcase in https://github.com/harp-lab/slog-lang1/tree/master/slog/tests/testcase , there is some CI script could read in test case there

@sowmith1999
Copy link
Member Author

This commit has that added and the script is able to pick it up

eb8e1e7

@sowmith1999 sowmith1999 marked this pull request as draft May 17, 2024 02:17
@sowmith1999
Copy link
Member Author

This commit only supports strings when loaded from the slog file and fails when loaded from csv files, as does the main branch.

@sowmith1999
Copy link
Member Author

#49 Issue is also also worked in this PR, along with support for spaces in strings

modified compiler/src/interpreter.rkt, strings in the source file were being hashed with quotes, but were being written to strings.csv without the quotes.
modified client.py to remove the extra quotes being added, and causing hash mismatch for strings loaded from csv.
added a test in stringtest in CI
@sowmith1999 sowmith1999 marked this pull request as ready for review May 23, 2024 06:23
@sowmith1999
Copy link
Member Author

@StarGazerM Strings from fact files work, CI test goes through. Please let me know if there is any concern.

@thomasgilray thomasgilray merged commit dc13f51 into master May 23, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants