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

Added syntax highlighting for strings #595

Merged
merged 2 commits into from
Jul 29, 2020
Merged

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Jul 27, 2020

It changes the following:

  • Added syntax highlighting for strings ("", '')
  • Split rustyline helper to a separate file (helper.rs)
  • Made colors for highlighting constants.

@HalidOdat HalidOdat added enhancement New feature or request cli Issues and PRs related to the Boa command line interface. labels Jul 27, 2020
@HalidOdat HalidOdat added this to the v0.10.0 milestone Jul 27, 2020
@codecov
Copy link

codecov bot commented Jul 27, 2020

Codecov Report

Merging #595 into master will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #595      +/-   ##
==========================================
- Coverage   71.11%   71.09%   -0.02%     
==========================================
  Files         176      177       +1     
  Lines       11503    11505       +2     
==========================================
  Hits         8180     8180              
- Misses       3323     3325       +2     
Impacted Files Coverage Δ
boa_cli/src/helper.rs 0.00% <0.00%> (ø)
boa_cli/src/main.rs 33.33% <ø> (+27.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 667a820...639b4cc. Read the comment docs.

@github-actions
Copy link

Benchmark for 33924fd

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 316.4±15.74ns 326.4±23.77ns -3.06%
Arithmetic operations (Full) 140.9±9.37µs 139.7±7.33µs +0.86%
Array access (Execution) 12.2±0.88µs 11.9±1.00µs +2.52%
Array access (Full) 158.2±8.28µs 161.0±8.91µs -1.74%
Array creation (Execution) 3.2±0.18ms 3.2±0.14ms 0.00%
Array creation (Full) 3.4±0.14ms 3.4±0.14ms 0.00%
Array pop (Execution) 1222.3±75.88µs 1238.6±91.28µs -1.32%
Array pop (Full) 1484.0±102.31µs 1506.2±90.01µs -1.47%
Boolean Object Access (Execution) 3.6±0.21µs 3.6±0.23µs 0.00%
Boolean Object Access (Full) 149.9±12.06µs 152.8±9.84µs -1.90%
Create Realm 128.7±7.70µs 129.2±6.98µs -0.39%
Dynamic Object Property Access (Execution) 5.5±0.35µs 5.5±0.35µs 0.00%
Dynamic Object Property Access (Full) 164.2±10.78µs 155.0±9.64µs +5.94%
Expression (Lexer) 1991.9±131.80ns 1999.5±133.31ns -0.38%
Expression (Parser) 4.6±0.33µs 4.6±0.35µs 0.00%
Fibonacci (Execution) 824.4±38.39µs 829.0±63.54µs -0.55%
Fibonacci (Full) 1023.9±69.81µs 1019.4±65.48µs +0.44%
For loop (Execution) 19.2±1.15µs 19.6±1.03µs -2.04%
For loop (Full) 167.8±15.40µs 167.9±10.61µs -0.06%
For loop (Lexer) 4.4±0.25µs 4.4±0.28µs 0.00%
For loop (Parser) 12.0±0.59µs 11.8±0.80µs +1.69%
Goal Symbols (Parser) 7.3±0.65µs 7.1±0.38µs +2.82%
Hello World (Lexer) 681.5±38.95ns 712.5±46.25ns -4.35%
Hello World (Parser) 1853.3±110.98ns 1865.3±111.07ns -0.64%
Long file (Parser) 5.4±0.22ms 5.4±0.23ms 0.00%
Number Object Access (Execution) 2.8±0.19µs 2.8±0.13µs 0.00%
Number Object Access (Full) 144.8±9.88µs 146.8±8.92µs -1.36%
Object Creation (Execution) 4.8±0.28µs 4.8±0.41µs 0.00%
Object Creation (Full) 166.1±9.02µs 175.5±13.17µs -5.36%
RegExp (Execution) 55.5±3.49µs 58.0±4.30µs -4.31%
RegExp (Full) 217.9±12.46µs 213.7±11.95µs +1.97%
RegExp Literal (Execution) 59.5±3.99µs 60.3±4.01µs -1.33%
RegExp Literal (Full) 212.7±11.78µs 215.6±25.50µs -1.35%
RegExp Literal Creation (Execution) 56.3±3.14µs 56.5±3.39µs -0.35%
RegExp Literal Creation (Full) 265.2±15.83µs 250.7±16.71µs +5.78%
Static Object Property Access (Execution) 4.8±0.30µs 4.9±0.31µs -2.04%
Static Object Property Access (Full) 162.4±8.61µs 155.2±11.12µs +4.64%
String Object Access (Execution) 6.9±0.48µs 6.8±0.44µs +1.47%
String Object Access (Full) 150.2±9.31µs 152.7±9.37µs -1.64%
String comparison (Execution) 5.6±0.41µs 5.6±0.34µs 0.00%
String comparison (Full) 154.3±9.77µs 150.8±10.15µs +2.32%
String concatenation (Execution) 4.6±0.35µs 4.7±0.30µs -2.13%
String concatenation (Full) 147.7±7.79µs 147.8±9.40µs -0.07%
String copy (Execution) 3.5±0.29µs 3.7±0.26µs -5.41%
String copy (Full) 144.0±8.57µs 143.5±8.05µs +0.35%
Symbols (Execution) 3.0±0.20µs 3.1±0.27µs -3.23%
Symbols (Full) 138.7±7.70µs 139.5±8.58µs -0.57%

boa_cli/src/main.rs Outdated Show resolved Hide resolved
@HalidOdat HalidOdat force-pushed the feature/string-highlighting branch from 530f45f to 639b4cc Compare July 28, 2020 02:05
@HalidOdat HalidOdat requested a review from Lan2u July 28, 2020 02:18
@github-actions
Copy link

Benchmark for 0a1d3f3

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 326.2±14.93ns 319.9±17.23ns +1.97%
Arithmetic operations (Full) 143.3±8.28µs 147.0±9.97µs -2.52%
Array access (Execution) 7.1±0.39µs 7.1±0.48µs 0.00%
Array access (Full) 155.5±8.28µs 155.5±12.12µs 0.00%
Array creation (Execution) 2.9±0.11ms 2.9±0.12ms 0.00%
Array creation (Full) 3.2±0.11ms 3.2±0.15ms 0.00%
Array pop (Execution) 1034.5±50.78µs 1048.8±57.90µs -1.36%
Array pop (Full) 1323.6±62.54µs 1345.1±76.79µs -1.60%
Boolean Object Access (Execution) 3.7±0.20µs 3.7±0.21µs 0.00%
Boolean Object Access (Full) 149.5±7.71µs 149.6±6.70µs -0.07%
Create Realm 128.7±6.75µs 133.3±8.61µs -3.45%
Dynamic Object Property Access (Execution) 4.3±0.19µs 4.5±0.27µs -4.44%
Dynamic Object Property Access (Full) 150.2±7.91µs 147.9±8.02µs +1.56%
Expression (Lexer) 2.0±0.11µs 2.1±0.15µs -4.76%
Expression (Parser) 4.6±0.28µs 4.8±0.33µs -4.17%
Fibonacci (Execution) 813.4±39.49µs 830.5±44.95µs -2.06%
Fibonacci (Full) 987.2±39.54µs 988.6±40.96µs -0.14%
For loop (Execution) 19.1±1.28µs 19.2±1.27µs -0.52%
For loop (Full) 163.4±9.22µs 165.3±11.05µs -1.15%
For loop (Lexer) 4.5±0.24µs 4.5±0.22µs 0.00%
For loop (Parser) 12.2±0.65µs 12.4±0.67µs -1.61%
Goal Symbols (Parser) 7.5±0.45µs 7.4±0.41µs +1.35%
Hello World (Lexer) 702.1±39.93ns 709.6±42.27ns -1.06%
Hello World (Parser) 1888.7±100.49ns 1919.6±127.27ns -1.61%
Long file (Parser) 5.5±0.16ms 5.7±0.21ms -3.51%
Number Object Access (Execution) 2.9±0.18µs 2.9±0.16µs 0.00%
Number Object Access (Full) 152.4±8.05µs 148.5±8.57µs +2.63%
Object Creation (Execution) 3.6±0.18µs 3.7±0.19µs -2.70%
Object Creation (Full) 170.5±12.01µs 165.4±8.98µs +3.08%
RegExp (Execution) 56.5±2.78µs 57.8±3.04µs -2.25%
RegExp (Full) 239.2±25.49µs 216.7±10.40µs +10.38%
RegExp Literal (Execution) 61.5±3.26µs 60.9±3.58µs +0.99%
RegExp Literal (Full) 216.4±11.95µs 217.9±12.20µs -0.69%
RegExp Literal Creation (Execution) 58.1±3.30µs 57.9±3.36µs +0.35%
RegExp Literal Creation (Full) 252.5±14.37µs 251.7±14.69µs +0.32%
Static Object Property Access (Execution) 3.8±0.19µs 3.8±0.25µs 0.00%
Static Object Property Access (Full) 150.0±6.72µs 151.8±10.36µs -1.19%
String Object Access (Execution) 5.5±0.39µs 5.5±0.35µs 0.00%
String Object Access (Full) 153.7±9.11µs 151.2±7.98µs +1.65%
String comparison (Execution) 5.0±0.28µs 5.1±0.23µs -1.96%
String comparison (Full) 152.9±8.39µs 156.8±9.39µs -2.49%
String concatenation (Execution) 4.1±0.23µs 4.2±0.36µs -2.38%
String concatenation (Full) 149.9±9.54µs 148.2±9.55µs +1.15%
String copy (Execution) 3.0±0.14µs 3.1±0.17µs -3.23%
String copy (Full) 143.8±7.60µs 141.3±7.07µs +1.77%
Symbols (Execution) 2.5±0.14µs 2.6±0.14µs -3.85%
Symbols (Full) 140.9±7.72µs 141.1±8.80µs -0.14%

@HalidOdat HalidOdat merged commit 4474b71 into master Jul 29, 2020
@HalidOdat HalidOdat deleted the feature/string-highlighting branch July 29, 2020 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issues and PRs related to the Boa command line interface. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants