Page MenuHomePhabricator

Lexer/Tokenizer
ClosedPublic

Authored by ardunster on Feb 5 2021, 5:43 PM.

Details

Summary

Related to tasks T1378 and T1403, setting up tokenizing for math inputs.

Test Plan

Goldilocks 1 tests integrated into console.

Revert Plan

na

Diff Detail

Repository
rR Ratscript
Branch
T1378
Lint
Lint Passed

Event Timeline

Restricted Application completed remote builds in Restricted Buildable.Feb 5 2021, 5:43 PM
  • Rename token_types, work on lexer
Restricted Application completed remote builds in Restricted Buildable.Feb 10 2021, 5:10 PM
  • Work on lexer logic, tokens, models, comments; change int to uint
Restricted Application completed remote builds in Restricted Buildable.Feb 11 2021, 5:20 PM
  • Additional work on Lexer, definitions, models
Restricted Application completed remote builds in Restricted Buildable.Feb 17 2021, 3:37 PM
  • rename Models to Model, continue work on lexer, add hashmap to token types
Restricted Application completed remote builds in Restricted Buildable.Feb 19 2021, 2:53 PM
  • Merge devel
  • Update clang-format
  • Continue work on lexer
  • Lexer first pass mostly done, start work on console and file interface
Restricted Application completed remote builds in Restricted Buildable.Feb 26 2021, 1:59 PM
  • Remove unused files
  • Update gitignore and change directory names to prepare for merge
  • Merge build system update to 3.1.0
Restricted Application completed remote builds in Restricted Buildable.Feb 27 2021, 12:05 PM
  • Merge build system 3.2.0 changes
  • Rearrange code out of console and into ratscript files
Restricted Application completed remote builds in Restricted Buildable.Mar 2 2021, 3:48 PM
  • Fix multiple definition errors by moving Model namespace to lexer
  • Work on getting console input working
Restricted Application completed remote builds in Restricted Buildable.Mar 5 2021, 3:14 PM

TODO next: figure out how to stringify Tokens, figure out how to convert onestrings to std::string and get hashmap working.

  • Set up keyword hashmap and overload stream insertion operator for TokenType
Restricted Application completed remote builds in Restricted Buildable.Mar 6 2021, 1:14 PM
  • Stringify tokens, work on debug in lexer
Restricted Application completed remote builds in Restricted Buildable.Mar 8 2021, 3:51 PM

Todo: Fix IOCat commands if working properly, debug line numbers, modify for testing and write tests. Also figure out whether comments are parsing wrong or if I was confused, and fix.

Build has FAILED

Building Ratscript on mpm-bionic-000294d0fnwi8 as build 4.

Link to build: https://jenkins.mousepawmedia.net:8449/job/ratscript_build/4/
See console output for more information: https://jenkins.mousepawmedia.net:8449/job/ratscript_build/4/console

Build has FAILED

Building Ratscript on mpm-bionic-000297qa31j3x as build 5.

Link to build: https://jenkins.mousepawmedia.net:8449/job/ratscript_build/5/
See console output for more information: https://jenkins.mousepawmedia.net:8449/job/ratscript_build/5/console

Build is green

Building Ratscript on mpm-bionic-000299fb4s19n as build 6.

See https://jenkins.mousepawmedia.net:8449/job/ratscript_build/6/ for more details.

Build is green

Building Ratscript on mpm-bionic-00029k5eboub5 as build 7.
Running tests.

See https://jenkins.mousepawmedia.net:8449/job/ratscript_build/7/ for more details.

Build is green

Building Ratscript on mpm-bionic-0002a9a1w0l69 as build 8.

See https://jenkins.mousepawmedia.net:8449/job/ratscript_build/8/ for more details.

  • Adjusted outer makefile to make console when using make ready
  • Setup test framework, get includes working
  • Overload == and != for Token, work on tests

Build is green

Building Ratscript on mpm-bionic-0002chvbpa7wd as build 9.
Running tests.

See https://jenkins.mousepawmedia.net:8449/job/ratscript_build/9/ for more details.

Restricted Application completed remote builds in Restricted Buildable.Mar 9 2021, 3:23 PM
  • Adjust outer.mk
  • Troubleshoot tests, write more tests

Build is green

Building Ratscript on mpm-bionic-00035dpz1375f as build 10.
Running tests.

See https://jenkins.mousepawmedia.net:8449/job/ratscript_build/10/ for more details.

Restricted Application completed remote builds in Restricted Buildable.Mar 10 2021, 2:01 PM

TODO: Test numbers, non keyword identifiers, newline, comments.

  • Run format on all cpp and hpp files
  • Clean up formatting and comments
  • Add and troubleshoot numerical test
  • Test non-keyword identifiers and troubleshoot
  • Write test for newlines, add COLON to tokentypes
  • Add tests for comments, moved comment logic and newline logic to functions
  • Add testing for strings and troubleshoot

Build is green

Building Ratscript on mpm-bionic-0004v9skzor6a as build 11.
Running tests.

See https://jenkins.mousepawmedia.net:8449/job/ratscript_build/11/ for more details.

Restricted Application completed remote builds in Restricted Buildable.Mar 12 2021, 2:32 PM

I think this is finally ready for review. I know it's super long :( If any of you have time to look over even a file or two at a time, that'd be great! All my tests are passing but I'm insecure about how well I wrote the tests. Totally open to suggestions for more things to test!

  • Adjust run_prompt to run in loop instead of single run

Build is green

Building Ratscript on mpm-bionic-0005ms5dvvvs2 as build 12.
Running tests.

See https://jenkins.mousepawmedia.net:8449/job/ratscript_build/12/ for more details.

Restricted Application completed remote builds in Restricted Buildable.Mar 13 2021, 12:05 PM
mahussain requested changes to this revision.EditedMar 13 2021, 12:28 PM

Looks fine to me

wait i didn't request changes i thought i had accepted it.

This revision now requires changes to proceed.Mar 13 2021, 12:28 PM
This revision is now accepted and ready to land.Mar 13 2021, 1:03 PM
This revision was automatically updated to reflect the committed changes.